Search in sources :

Example 6 with PSSParameterSpec

use of java.security.spec.PSSParameterSpec in project j2objc by google.

the class PSSParameterSpecTest method testGetDigestAlgorithm.

/**
     * Test for <code>getDigestAlgorithm()</code> method
     * Assertion: returns message digest algorithm name
     */
public final void testGetDigestAlgorithm() {
    PSSParameterSpec pssps = new PSSParameterSpec("SHA-1", "MGF1", MGF1ParameterSpec.SHA1, 20, 1);
    assertEquals("SHA-1", pssps.getDigestAlgorithm());
}
Also used : PSSParameterSpec(java.security.spec.PSSParameterSpec)

Example 7 with PSSParameterSpec

use of java.security.spec.PSSParameterSpec in project j2objc by google.

the class PSSParameterSpecTest method testGetMGFParameters02.

/**
     * Test #2 for <code>getMGFParameters()</code> method
     * Assertion: returns <code>null</code>
     * if <code>null</code> had been passed as
     * AlgorithmParameterSpec parameter to the ctor
     */
public final void testGetMGFParameters02() {
    PSSParameterSpec pssps = new PSSParameterSpec("SHA-1", "MGF1", null, 20, 1);
    assertNull(pssps.getMGFParameters());
}
Also used : PSSParameterSpec(java.security.spec.PSSParameterSpec)

Example 8 with PSSParameterSpec

use of java.security.spec.PSSParameterSpec in project j2objc by google.

the class PSSParameterSpecTest method testPSSParameterSpec0201.

/**
     * Test #1 for
     * <code>
     * PSSParameterSpec(String,String,AlgorithmParameterSpec,int,int)
     * </code> ctor<br>
     * Assertion: constructs using valid parameters
     * <code>PSSParameterSpec<code> object
     */
public final void testPSSParameterSpec0201() {
    AlgorithmParameterSpec aps = new PSSParameterSpec("SHA-1", "MGF1", MGF1ParameterSpec.SHA1, 20, 1);
    assertTrue(aps instanceof PSSParameterSpec);
}
Also used : PSSParameterSpec(java.security.spec.PSSParameterSpec) AlgorithmParameterSpec(java.security.spec.AlgorithmParameterSpec)

Example 9 with PSSParameterSpec

use of java.security.spec.PSSParameterSpec in project j2objc by google.

the class PSSParameterSpecTest method testPSSParameterSpec0101.

/**
     * Test #1 for <code>PSSParameterSpec(int)</code> ctor<br>
     * Assertion: constructs using valid parameter
     * <code>PSSParameterSpec<code> object
     */
public final void testPSSParameterSpec0101() {
    AlgorithmParameterSpec aps = new PSSParameterSpec(20);
    assertTrue(aps instanceof PSSParameterSpec);
}
Also used : PSSParameterSpec(java.security.spec.PSSParameterSpec) AlgorithmParameterSpec(java.security.spec.AlgorithmParameterSpec)

Example 10 with PSSParameterSpec

use of java.security.spec.PSSParameterSpec in project j2objc by google.

the class PSSParameterSpecTest method testGetMGFParameters01.

/**
     * Test #1 for <code>getMGFParameters()</code> method
     * Assertion: returns mask generation function parameters
     */
public final void testGetMGFParameters01() {
    PSSParameterSpec pssps = new PSSParameterSpec("SHA-1", "MGF1", MGF1ParameterSpec.SHA1, 20, 1);
    assertTrue(MGF1ParameterSpec.SHA1.equals(pssps.getMGFParameters()));
}
Also used : PSSParameterSpec(java.security.spec.PSSParameterSpec)

Aggregations

PSSParameterSpec (java.security.spec.PSSParameterSpec)20 AlgorithmParameterSpec (java.security.spec.AlgorithmParameterSpec)4 Signature (java.security.Signature)2 SignatureAlgorithm (io.jsonwebtoken.SignatureAlgorithm)1 IOException (java.io.IOException)1 AlgorithmParameters (java.security.AlgorithmParameters)1 GeneralSecurityException (java.security.GeneralSecurityException)1 InvalidAlgorithmParameterException (java.security.InvalidAlgorithmParameterException)1 InvalidKeyException (java.security.InvalidKeyException)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 NoSuchProviderException (java.security.NoSuchProviderException)1 CertificateException (java.security.cert.CertificateException)1 MGF1ParameterSpec (java.security.spec.MGF1ParameterSpec)1 HashMap (java.util.HashMap)1 Mac (javax.crypto.Mac)1 DHGenParameterSpec (javax.crypto.spec.DHGenParameterSpec)1 SecretKeySpec (javax.crypto.spec.SecretKeySpec)1 OperatorCreationException (org.bouncycastle.operator.OperatorCreationException)1