Examples of encryptData()


Examples of com.sun.org.apache.xml.internal.security.encryption.XMLCipher.encryptData()

            final byte[] skey = WSTrustUtil.generateRandomSecret(keysizeInBytes);
            cipher.init(XMLCipher.ENCRYPT_MODE, new SecretKeySpec(skey, "AES"));
               
            // Encrypt the assertion and return the Encrypteddata
            final Document owner = assertion.getOwnerDocument();
            final EncryptedData encData = cipher.encryptData(owner, assertion);
            final String id = "uuid-" + UUID.randomUUID().toString();
            encData.setId(id);
               
            final KeyInfo encKeyInfo = new KeyInfo(owner);
            final EncryptedKey encKey = encryptKey(owner, skey, serCert, appliesTo, keyWrapAlgorithm);
View Full Code Here

Examples of com.sun.org.apache.xml.internal.security.encryption.XMLCipher.encryptData()

            final byte[] skey = WSTrustUtil.generateRandomSecret(keysizeInBytes);
            cipher.init(XMLCipher.ENCRYPT_MODE, new SecretKeySpec(skey, "AES"));
               
            // Encrypt the assertion and return the Encrypteddata
            final Document owner = assertion.getOwnerDocument();
            final EncryptedData encData = cipher.encryptData(owner, assertion);
            final String id = "uuid-" + UUID.randomUUID().toString();
            encData.setId(id);
               
            final KeyInfo encKeyInfo = new KeyInfo(owner);
            final EncryptedKey encKey = WSTrustUtil.encryptKey(owner, skey, serCert, keyWrapAlgorithm);
View Full Code Here

Examples of com.sun.xml.ws.security.opt.impl.enc.CryptoProcessor.encryptData()

        saaj.addAttachmentPart(part);
    }
   
    private void doEncryption() throws XWSSecurityException{
        CryptoProcessor dep = new CryptoProcessor(Cipher.ENCRYPT_MODE, dataAlgo, key);
        data = dep.encryptData(attachment.asByteArray());
    }

}
View Full Code Here

Examples of org.apache.derby.client.am.EncryptionManager.encryptData()

            int encryptedBytesLength = 0;
            byte[] encryptedBytes = null;
            try {
                EncryptionManager encryptionMgr = netAgent_.netConnection_.getEncryptionManager();
                byte[] publicKey = netAgent_.netConnection_.getTargetPublicKey();
                encryptedBytes = encryptionMgr.encryptData(newClearedBytes,
                        NetConfiguration.SECMEC_EUSRIDPWD,
                        publicKey,
                        publicKey);
                encryptedBytesLength = encryptedBytes.length;
            } catch (Exception e) {
View Full Code Here

Examples of org.apache.derby.client.am.EncryptionManager.encryptData()

            int encryptedBytesLength = 0;
            byte[] encryptedBytes = null;
            try {
                EncryptionManager encryptionMgr = netAgent_.netConnection_.getEncryptionManager();
                byte[] publicKey = netAgent_.netConnection_.getTargetPublicKey();
                encryptedBytes = encryptionMgr.encryptData(newClearedBytes,
                        NetConfiguration.SECMEC_EUSRIDPWD,
                        publicKey,
                        publicKey);
                encryptedBytesLength = encryptedBytes.length;
            } catch (Exception e) {
View Full Code Here

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

            throw new EncryptionException("Error initializing cipher instance", e);
        }

        org.apache.xml.security.encryption.EncryptedData apacheEncryptedData;
        try {
            apacheEncryptedData = xmlCipher.encryptData(ownerDocument, targetElement, encryptContentMode);
        } catch (Exception e) {
            log.error("Error encrypting XMLObject", e);
            throw new EncryptionException("Error encrypting XMLObject", e);
        }
View Full Code Here

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

            throw new EncryptionException("Error initializing cipher instance", e);
        }

        org.apache.xml.security.encryption.EncryptedData apacheEncryptedData;
        try {
            apacheEncryptedData = xmlCipher.encryptData(ownerDocument, targetElement, encryptContentMode);
        } catch (Exception e) {
            log.error("Error encrypting XMLObject", e);
            throw new EncryptionException("Error encrypting XMLObject", e);
        }
View Full Code Here

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

            final byte[] skey = WSTrustUtil.generateRandomSecret(keysizeInBytes);
            cipher.init(XMLCipher.ENCRYPT_MODE, new SecretKeySpec(skey, "AES"));
               
            // Encrypt the assertion and return the Encrypteddata
            final Document owner = assertion.getOwnerDocument();
            final EncryptedData encData = cipher.encryptData(owner, assertion);
            final String id = "uuid-" + UUID.randomUUID().toString();
            encData.setId(id);
               
            final KeyInfo encKeyInfo = new KeyInfo(owner);
            final EncryptedKey encKey = encryptKey(owner, skey, serCert, appliesTo, keyWrapAlgorithm);
View Full Code Here

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

            final byte[] skey = WSTrustUtil.generateRandomSecret(keysizeInBytes);
            cipher.init(XMLCipher.ENCRYPT_MODE, new SecretKeySpec(skey, "AES"));
               
            // Encrypt the assertion and return the Encrypteddata
            final Document owner = assertion.getOwnerDocument();
            final EncryptedData encData = cipher.encryptData(owner, assertion);
            final String id = "uuid-" + UUID.randomUUID().toString();
            encData.setId(id);
               
            final KeyInfo encKeyInfo = new KeyInfo(owner);
            final EncryptedKey encKey = WSTrustUtil.encryptKey(owner, skey, serCert, keyWrapAlgorithm);
View Full Code Here

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

            throw new EncryptionException("Error initializing cipher instance", e);
        }

        org.apache.xml.security.encryption.EncryptedData apacheEncryptedData;
        try {
            apacheEncryptedData = xmlCipher.encryptData(ownerDocument, targetElement, encryptContentMode);
        } catch (Exception e) {
            log.error("Error encrypting XMLObject", e);
            throw new EncryptionException("Error encrypting XMLObject", 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.