Examples of martial()


Examples of org.apache.xml.security.encryption.XMLCipher.martial()

        XMLCipher dcipher = XMLCipher.getInstance(XMLCipher.AES_128);
        dcipher.init(XMLCipher.DECRYPT_MODE, key);
        Assert.assertEquals
            (encryptedData.getEncryptionMethod().getAlgorithm(),
             XMLCipher.AES_128);
        byte[] bytes = dcipher.decryptToByteArray(dcipher.martial(encryptedData));
        String after = new String(bytes, "UTF-8");
        Assert.assertEquals(before, after);

  // test with null type
        encryptedData = cipher.encryptData
View Full Code Here

Examples of org.apache.xml.security.encryption.XMLCipher.martial()

        XMLCipher dcipher = XMLCipher.getInstance(XMLCipher.AES_128);
        dcipher.init(XMLCipher.DECRYPT_MODE, key);
        Assert.assertEquals
            (encryptedData.getEncryptionMethod().getAlgorithm(),
             XMLCipher.AES_128);
        byte[] bytes = dcipher.decryptToByteArray(dcipher.martial(encryptedData));
        String after = new String(bytes, "UTF-8");
        Assert.assertEquals(before, after);

  // test with null type
        encryptedData = cipher.encryptData
View Full Code Here

Examples of org.apache.xml.security.encryption.XMLCipher.martial()

            throw new EncryptionException("Error encrypting element on key encryption", e);
        }

        EncryptedKey encryptedKey;
        try {
            Element encKeyElement = xmlCipher.martial(containingDocument, apacheEncryptedKey);
            encryptedKey = (EncryptedKey) encryptedKeyUnmarshaller.unmarshall(encKeyElement);
        } catch (UnmarshallingException e) {
            log.error("Error unmarshalling EncryptedKey element", e);
            throw new EncryptionException("Error unmarshalling EncryptedKey element");
        }
View Full Code Here

Examples of org.apache.xml.security.encryption.XMLCipher.martial()

            throw new EncryptionException("Error encrypting XMLObject", e);
        }

        EncryptedData encryptedData;
        try {
            Element encDataElement = xmlCipher.martial(ownerDocument, apacheEncryptedData);
            encryptedData = (EncryptedData) encryptedDataUnmarshaller.unmarshall(encDataElement);
        } catch (UnmarshallingException e) {
            log.error("Error unmarshalling EncryptedData element", e);
            throw new EncryptionException("Error unmarshalling EncryptedData element", e);
        }
View Full Code Here

Examples of org.apache.xml.security.encryption.XMLCipher.martial()

            final KeyInfo encKeyInfo = new KeyInfo(owner);
            final EncryptedKey encKey = encryptKey(owner, skey, serCert, appliesTo, keyWrapAlgorithm);
            encKeyInfo.add(encKey);
            encData.setKeyInfo(encKeyInfo);
           
            encDataEle = cipher.martial(encData);
         } catch (XMLEncryptionException ex) {
            log.log(Level.SEVERE,
                            LogStringsMessages.WST_0044_ERROR_ENCRYPT_ISSUED_TOKEN(appliesTo), ex);
            throw new WSTrustException( LogStringsMessages.WST_0040_ERROR_ENCRYPT_PROOFKEY(appliesTo), ex);
        } catch (Exception ex) {
View Full Code Here

Examples of org.apache.xml.security.encryption.XMLCipher.martial()

                        ekCache.put(x509TokenId, id);
                        // set its KeyInfo
                        encryptedKey.setKeyInfo(apacheKeyInfo);
                       
                        // insert the EK into the SOAPMessage
                        SOAPElement se = (SOAPElement)keyEncryptor.martial(encryptedKey);
                        if (insertedx509 == null) {
                            secureMessage.findOrCreateSecurityHeader().insertHeaderBlockElement(se);
                        } else {
                            secureMessage.findOrCreateSecurityHeader().insertBefore(se,insertedx509.getNextSibling());
                        }
View Full Code Here

Examples of org.apache.xml.security.encryption.XMLCipher.martial()

                            if (insertedx509 != null) {
                                nsX509 = insertedx509.getNextSibling();
                            }
                           
                            // insert the EK into the SOAPMessage -  this goes on top of DKT Header block
                            SOAPElement se = (SOAPElement)keyEncryptor.martial(encryptedKey);
                            if (nsX509 == null) {
                                secureMessage.findOrCreateSecurityHeader().insertHeaderBlockElement(se);
                            }else {
                                secureMessage.findOrCreateSecurityHeader().insertBefore(se, nsX509);
                            }
View Full Code Here

Examples of org.apache.xml.security.encryption.XMLCipher.martial()

            final KeyInfo encKeyInfo = new KeyInfo(owner);
            final EncryptedKey encKey = WSTrustUtil.encryptKey(owner, skey, serCert, keyWrapAlgorithm);
            encKeyInfo.add(encKey);
            encData.setKeyInfo(encKeyInfo);
           
            encDataEle = cipher.martial(encData);
         } catch (XMLEncryptionException ex) {
            log.log(Level.SEVERE,
                            LogStringsMessages.WST_0044_ERROR_ENCRYPT_ISSUED_TOKEN(appliesTo), ex);
            throw new WSTrustException( LogStringsMessages.WST_0040_ERROR_ENCRYPT_PROOFKEY(appliesTo), ex);
        } catch (Exception ex) {
View Full Code Here

Examples of org.apache.xml.security.encryption.XMLCipher.martial()

            throw new EncryptionException("Error encrypting element on key encryption", e);
        }

        EncryptedKey encryptedKey;
        try {
            Element encKeyElement = xmlCipher.martial(containingDocument, apacheEncryptedKey);
            encryptedKey = (EncryptedKey) encryptedKeyUnmarshaller.unmarshall(encKeyElement);
        } catch (UnmarshallingException e) {
            log.error("Error unmarshalling EncryptedKey element", e);
            throw new EncryptionException("Error unmarshalling EncryptedKey element");
        }
View Full Code Here

Examples of org.apache.xml.security.encryption.XMLCipher.martial()

            throw new EncryptionException("Error encrypting XMLObject", e);
        }

        EncryptedData encryptedData;
        try {
            Element encDataElement = xmlCipher.martial(ownerDocument, apacheEncryptedData);
            encryptedData = (EncryptedData) encryptedDataUnmarshaller.unmarshall(encDataElement);
        } catch (UnmarshallingException e) {
            log.error("Error unmarshalling EncryptedData element", e);
            throw new EncryptionException("Error unmarshalling EncryptedData element", e);
        }
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.