Examples of toRSAPrivateKey()


Examples of com.nimbusds.jose.jwk.RSAKey.toRSAPrivateKey()

    assertEquals(JWEAlgorithm.RSA1_5, jweObject.getHeader().getAlgorithm());
    assertEquals(EncryptionMethod.A128CBC_HS256, jweObject.getHeader().getEncryptionMethod());
    assertEquals("frodo.baggins@hobbiton.example", jweObject.getHeader().getKeyID());

    JWEDecrypter decrypter = new RSADecrypter(jwk.toRSAPrivateKey());

    jweObject.decrypt(decrypter);

    assertEquals(JWEObject.State.DECRYPTED, jweObject.getState());
  }
View Full Code Here

Examples of com.nimbusds.jose.jwk.RSAKey.toRSAPrivateKey()

    // Create signer from JWK representation
    RSAKey rsaJWK = new RSAKey.Builder(rsaPublicKey).privateKey(rsaPrivateKey).build();

    JWSObject jwsObject2 = new JWSObject(new JWSHeader(JWSAlgorithm.RS256), new Payload("test123"));
    signer = new RSASSASigner(rsaJWK.toRSAPrivateKey());
    jwsObject2.sign(signer);
    Base64URL sig2 = jwsObject2.getSignature();

    assertTrue("Signature comparison", sig1.equals(sig2));
View Full Code Here

Examples of com.nimbusds.jose.jwk.RSAKey.toRSAPrivateKey()

    assertEquals(JWEAlgorithm.RSA_OAEP, jweObject.getHeader().getAlgorithm());
    assertEquals(EncryptionMethod.A256GCM, jweObject.getHeader().getEncryptionMethod());
    assertEquals("samwise.gamgee@hobbiton.example", jweObject.getHeader().getKeyID());

    JWEDecrypter decrypter = new RSADecrypter(jwk.toRSAPrivateKey());

    jweObject.decrypt(decrypter);

    assertEquals(JWEObject.State.DECRYPTED, jweObject.getState());
  }
View Full Code Here

Examples of com.nimbusds.jose.jwk.RSAKey.toRSAPrivateKey()

    JWEObject jweObject = JWEObject.parse(jweString);
   
    assertEquals(JWEAlgorithm.RSA_OAEP_256, jweObject.getHeader().getAlgorithm());
    assertEquals(EncryptionMethod.A128CBC_HS256, jweObject.getHeader().getEncryptionMethod());
   
    JWEDecrypter decrypter = new RSADecrypter(jwk.toRSAPrivateKey());
   
    // Get bouncycastle for the test
    Provider provider = BouncyCastleProviderSingleton.getInstance();
    decrypter.setKeyEncryptionProvider(provider);
    decrypter.setContentEncryptionProvider(provider);
View Full Code Here

Examples of com.nimbusds.jose.jwk.RSAKey.toRSAPrivateKey()

    // Create signer from JWK representation
    RSAKey rsaJWK = new RSAKey.Builder(rsaPublicKey).privateKey(rsaPrivateKey).build();

    JWSObject jwsObject2 = new JWSObject(new JWSHeader(JWSAlgorithm.RS256), new Payload("test123"));
    signer = new RSASSASigner(rsaJWK.toRSAPrivateKey());
    jwsObject2.sign(signer);
    Base64URL sig2 = jwsObject2.getSignature();

    assertTrue("Signature comparison", sig1.equals(sig2));
View Full Code Here

Examples of com.nimbusds.jose.jwk.RSAKey.toRSAPrivateKey()

    assertEquals(JWEAlgorithm.RSA_OAEP, jweObject.getHeader().getAlgorithm());
    assertEquals(EncryptionMethod.A256GCM, jweObject.getHeader().getEncryptionMethod());
    assertEquals("samwise.gamgee@hobbiton.example", jweObject.getHeader().getKeyID());

    JWEDecrypter decrypter = new RSADecrypter(jwk.toRSAPrivateKey());

    jweObject.decrypt(decrypter);

    assertEquals(JWEObject.State.DECRYPTED, jweObject.getState());
  }
View Full Code Here

Examples of com.nimbusds.jose.jwk.RSAKey.toRSAPrivateKey()

    JWEObject jweObject = JWEObject.parse(jweString);
   
    assertEquals(JWEAlgorithm.RSA_OAEP_256, jweObject.getHeader().getAlgorithm());
    assertEquals(EncryptionMethod.A128CBC_HS256, jweObject.getHeader().getEncryptionMethod());
   
    JWEDecrypter decrypter = new RSADecrypter(jwk.toRSAPrivateKey());
   
    // Get bouncycastle for the test
    Provider provider = BouncyCastleProviderSingleton.getInstance();
    decrypter.setKeyEncryptionProvider(provider);
    decrypter.setContentEncryptionProvider(provider);
View Full Code Here

Examples of com.nimbusds.jose.jwk.RSAKey.toRSAPrivateKey()

    assertEquals(JWEAlgorithm.RSA1_5, jweObject.getHeader().getAlgorithm());
    assertEquals(EncryptionMethod.A128CBC_HS256, jweObject.getHeader().getEncryptionMethod());
    assertEquals("frodo.baggins@hobbiton.example", jweObject.getHeader().getKeyID());

    JWEDecrypter decrypter = new RSADecrypter(jwk.toRSAPrivateKey());

    jweObject.decrypt(decrypter);

    assertEquals(JWEObject.State.DECRYPTED, jweObject.getState());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.