Package com.nimbusds.jose

Examples of com.nimbusds.jose.JWEHeader


      JwtEncryptionAndDecryptionService encrypter = encrypters.getEncrypter(client.getJwksUri());

      if (encrypter != null) {

        EncryptedJWT idToken = new EncryptedJWT(new JWEHeader(client.getIdTokenEncryptedResponseAlg(), client.getIdTokenEncryptedResponseEnc()), idClaims);

        encrypter.encryptJwt(idToken);

        idTokenEntity.setJwt(idToken);
View Full Code Here


    // Optional parameters
    for (Entry<String, String> option : options.entrySet()) {
      claims.setClaim(option.getKey(), option.getValue());
    }

    EncryptedJWT jwt = new EncryptedJWT(new JWEHeader(alg, enc), claims);

    JwtEncryptionAndDecryptionService encryptor = encrypterService.getEncrypter(serverConfig.getJwksUri());

    encryptor.encryptJwt(jwt);
View Full Code Here

        JwtEncryptionAndDecryptionService encrypter = encrypters.getEncrypter(client.getJwksUri());

        if (encrypter != null) {

          EncryptedJWT encrypted = new EncryptedJWT(new JWEHeader(client.getIdTokenEncryptedResponseAlg(), client.getIdTokenEncryptedResponseEnc()), claims);

          encrypter.encryptJwt(encrypted);


          Writer out = response.getWriter();
View Full Code Here

    service.setDefaultEncryptionKeyId(RSAkid);

    assertEquals(RSAkid,service.getDefaultEncryptionKeyId());
    assertEquals(RSAkid,service.getDefaultDecryptionKeyId());

    JWEHeader header = new JWEHeader(JWEAlgorithm.RSA_OAEP, EncryptionMethod.A256GCM);

    EncryptedJWT jwt = new EncryptedJWT(header, claimsSet);

    service.encryptJwt(jwt);
    String serialized = jwt.serialize();
View Full Code Here

    service.setDefaultEncryptionKeyId(null);

    assertEquals(RSAkid,service.getDefaultEncryptionKeyId());
    assertEquals(RSAkid,service.getDefaultDecryptionKeyId());

    JWEHeader header = new JWEHeader(JWEAlgorithm.RSA_OAEP, EncryptionMethod.A256GCM);

    EncryptedJWT jwt = new EncryptedJWT(header, claimsSet);

    service.encryptJwt(jwt);
    String serialized = jwt.serialize();
View Full Code Here

  public void encrypt_nullID_oneKey() {

    service_2.setDefaultEncryptionKeyId(null);
    assertEquals(null, service_2.getDefaultEncryptionKeyId());

    JWEHeader header = new JWEHeader(JWEAlgorithm.RSA_OAEP, EncryptionMethod.A256GCM);

    EncryptedJWT jwt = new EncryptedJWT(header, claimsSet);

    service_2.encryptJwt(jwt);
    assertEquals(null, service_2.getDefaultEncryptionKeyId());
View Full Code Here

    service_2.setDefaultDecryptionKeyId(null);

    assertEquals(RSAkid, service_2.getDefaultEncryptionKeyId());
    assertEquals(null, service_2.getDefaultDecryptionKeyId());

    JWEHeader header = new JWEHeader(JWEAlgorithm.RSA_OAEP, EncryptionMethod.A256GCM);

    EncryptedJWT jwt = new EncryptedJWT(header, claimsSet);
    service_2.encryptJwt(jwt);
    String serialized = jwt.serialize();
View Full Code Here


  public void testWithA128GCM()
    throws Exception {

    JWEHeader header = new JWEHeader(JWEAlgorithm.RSA_OAEP, EncryptionMethod.A128GCM);
    Payload payload = new Payload("Hello world!");

    JWEObject jweObject = new JWEObject(header, payload);

    assertEquals("State check", JWEObject.State.UNENCRYPTED, jweObject.getState());
View Full Code Here


  public void testwithSHA256AndA128GCM()
    throws Exception {

    JWEHeader header = new JWEHeader(JWEAlgorithm.RSA_OAEP_256, EncryptionMethod.A128GCM);
    Payload payload = new Payload("Hello world!");

    JWEObject jweObject = new JWEObject(header, payload);

    assertEquals("State check", JWEObject.State.UNENCRYPTED, jweObject.getState());
View Full Code Here


  public void testWithA192GCM()
    throws Exception {

    JWEHeader header = new JWEHeader(JWEAlgorithm.RSA_OAEP, EncryptionMethod.A192GCM);
    Payload payload = new Payload("Hello world!");

    JWEObject jweObject = new JWEObject(header, payload);

    assertEquals("State check", JWEObject.State.UNENCRYPTED, jweObject.getState());
View Full Code Here

TOP

Related Classes of com.nimbusds.jose.JWEHeader

Copyright © 2018 www.massapicom. 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.