Examples of EncryptionMethod


Examples of org.jboss.resteasy.jose.jwe.EncryptionMethod

      byte[] iv = Base64Url.decode(encodedIv);
      byte[] cipherText = Base64Url.decode(encodedCipherText);
      byte[] authTag = Base64Url.decode(encodedAuthTag);

      // Decrypt the cipher text according to the JWE enc
      EncryptionMethod enc = readOnlyJWEHeader.getEncryptionMethod();

      byte[] plainText;

      if (enc.equals(EncryptionMethod.A128CBC_HS256) || enc.equals(EncryptionMethod.A256CBC_HS512))
      {

         plainText = AESCBC.decryptAuthenticated(key, iv, cipherText, aad, authTag);

      }
      else if (enc.equals(EncryptionMethod.A128GCM) || enc.equals(EncryptionMethod.A256GCM))
      {

         plainText = AESGCM.decrypt(key, iv, cipherText, aad, authTag);

      }
View Full Code Here

Examples of org.jboss.resteasy.jose.jwe.EncryptionMethod

         throw new RuntimeException("Unsupported JWE algorithm, must be RSA1_5 or RSA_OAEP");
      }


      // Decrypt the cipher text according to the JWE enc
      EncryptionMethod enc = readOnlyJWEHeader.getEncryptionMethod();

      byte[] plainText;

      if (enc.equals(EncryptionMethod.A128CBC_HS256) || enc.equals(EncryptionMethod.A256CBC_HS512))
      {

         plainText = AESCBC.decryptAuthenticated(cek, iv, cipherText, aad, authTag);

      }
      else if (enc.equals(EncryptionMethod.A128GCM) || enc.equals(EncryptionMethod.A256GCM))
      {

         plainText = AESGCM.decrypt(cek, iv, cipherText, aad, authTag);

      }
View Full Code Here

Examples of org.opensaml.xml.encryption.EncryptionMethod

*/
public class EncryptionMethodMarshaller extends AbstractXMLEncryptionMarshaller {

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
        EncryptionMethod em = (EncryptionMethod) xmlObject;

        if (em.getAlgorithm() != null) {
            domElement.setAttributeNS(null, EncryptionMethod.ALGORITHM_ATTRIB_NAME, em.getAlgorithm());
        }
    }
View Full Code Here

Examples of org.opensaml.xml.encryption.EncryptionMethod

*/
public class EncryptionMethodUnmarshaller extends AbstractXMLEncryptionUnmarshaller {

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
        EncryptionMethod em = (EncryptionMethod) xmlObject;

        if (attribute.getLocalName().equals(EncryptionMethod.ALGORITHM_ATTRIB_NAME)) {
            em.setAlgorithm(attribute.getValue());
        } else {
            super.processAttribute(xmlObject, attribute);
        }
    }
View Full Code Here

Examples of org.opensaml.xml.encryption.EncryptionMethod

    }

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
            throws UnmarshallingException {
        EncryptionMethod em = (EncryptionMethod) parentXMLObject;
        if (childXMLObject instanceof KeySize) {
            em.setKeySize((KeySize) childXMLObject);
        } else if (childXMLObject instanceof OAEPparams) {
            em.setOAEPparams((OAEPparams) childXMLObject);
        } else {
            em.getUnknownXMLObjects().add(childXMLObject);
        }
    }
View Full Code Here

Examples of org.opensaml.xml.encryption.EncryptionMethod

*/
public class EncryptionMethodMarshaller extends AbstractXMLEncryptionMarshaller {

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
        EncryptionMethod em = (EncryptionMethod) xmlObject;

        if (em.getAlgorithm() != null) {
            domElement.setAttributeNS(null, EncryptionMethod.ALGORITHM_ATTRIB_NAME, em.getAlgorithm());
        }
    }
View Full Code Here

Examples of org.opensaml.xml.encryption.EncryptionMethod

*/
public class EncryptionMethodUnmarshaller extends AbstractXMLEncryptionUnmarshaller {

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
        EncryptionMethod em = (EncryptionMethod) xmlObject;

        if (attribute.getLocalName().equals(EncryptionMethod.ALGORITHM_ATTRIB_NAME)) {
            em.setAlgorithm(attribute.getValue());
        } else {
            super.processAttribute(xmlObject, attribute);
        }
    }
View Full Code Here

Examples of org.opensaml.xml.encryption.EncryptionMethod

    }

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
            throws UnmarshallingException {
        EncryptionMethod em = (EncryptionMethod) parentXMLObject;
        if (childXMLObject instanceof KeySize) {
            em.setKeySize((KeySize) childXMLObject);
        } else if (childXMLObject instanceof OAEPparams) {
            em.setOAEPparams((OAEPparams) childXMLObject);
        } else {
            em.getUnknownXMLObjects().add(childXMLObject);
        }
    }
View Full Code Here

Examples of org.opensaml.xml.encryption.EncryptionMethod

        cipherValue.setValue(Base64.encode(wsSecEncryptedKey.getEncryptedEphemeralKey()));

        CipherData cipherData = (CipherData)buildXMLObject(CipherData.DEFAULT_ELEMENT_NAME);
        cipherData.setCipherValue(cipherValue);

        EncryptionMethod encryptionMethod = (EncryptionMethod)buildXMLObject(EncryptionMethod.DEFAULT_ELEMENT_NAME);
        encryptionMethod.setAlgorithm(EncryptionConstants.ALGO_ID_KEYTRANSPORT_RSA15);

        EncryptedKey encryptedKey = (EncryptedKey)SAMLUtils.buildXMLObject(EncryptedKey.DEFAULT_ELEMENT_NAME);

        encryptedKey.setID(wsSecEncryptedKey.getId());
        encryptedKey.setEncryptionMethod(encryptionMethod);
View Full Code Here

Examples of org.picketlink.identity.xmlsec.w3.xmlenc.EncryptionMethodType.EncryptionMethod

        KeyDescriptorType keyDescriptor = new KeyDescriptorType();

        if (isNotNull(algorithm)) {
            EncryptionMethodType encryptionMethod = new EncryptionMethodType(algorithm);

            encryptionMethod.setEncryptionMethod(new EncryptionMethod(BigInteger.valueOf(keySize), null));

            keyDescriptor.addEncryptionMethod(encryptionMethod);
        }

        if (isSigningKey)
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.