Examples of handleEncryptedKey()


Examples of org.apache.ws.security.WSSecurityEngine.handleEncryptedKey()

            } catch (java.lang.Exception e) {
                throw new WSSecurityException(WSSecurityException.FAILED_ENC_DEC,
                        "RequestedProofToken: cannot create instance of password callback: "
                        + callback +":: ErrMsg "+e.getMessage());
            }
            secEngine.handleEncryptedKey((Element) ndList.item(0),
                    cbHandler,
                    crypto);

            this.sharedSecret = secEngine.getDecryptedBytes();
            log.debug(" RequestedProofToken, decryption ,Shared secret is :: " + new String(this.sharedSecret));
View Full Code Here

Examples of org.apache.ws.security.WSSecurityEngine.handleEncryptedKey()

      }else{
        throw new ConversationException("Cannot find passwordcallback");
      }

            WSSecurityEngine eng = new WSSecurityEngine();
            eng.handleEncryptedKey(eleEnc, cbHandler, crypto);
            byte[] key = eng.getDecryptedBytes();

            return key;

      }catch (WSSecurityException e1) {
View Full Code Here

Examples of org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey()

                throw new WSSecurityException(WSSecurityException.FAILED_ENC_DEC,
                        "RequestedProofToken: cannot create instance of password callback: "
                        + callback +":: ErrMsg "+e.getMessage());
            }
            EncryptedKeyProcessor processor = new EncryptedKeyProcessor();
            processor.handleEncryptedKey((Element) ndList.item(0),
                    cbHandler,
                    crypto);

            this.sharedSecret = processor.getDecryptedBytes();
            log.debug(" RequestedProofToken, decryption ,Shared secret is :: " + new String(this.sharedSecret));
View Full Code Here

Examples of org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey()

                        }
                        QName el = new QName(child.getNamespaceURI(), child.getLocalName());
                        if (el.equals(WSSecurityEngine.ENCRYPTED_KEY)) {
                           
                            EncryptedKeyProcessor proc = new EncryptedKeyProcessor();
                            proc.handleEncryptedKey((Element)child, cb, crypto, null);
                           
                            return new SAMLKeyInfo(assertion, proc.getDecryptedBytes());
                        } else if (el.equals(new QName(WSConstants.WST_NS, "BinarySecret"))) {
                            Text txt = (Text)child.getFirstChild();
                            return new SAMLKeyInfo(assertion, Base64.decode(txt.getData()));
View Full Code Here

Examples of org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey()

                        }
                        QName el = new QName(child.getNamespaceURI(), child.getLocalName());
                        if (el.equals(WSSecurityEngine.ENCRYPTED_KEY)) {

                            EncryptedKeyProcessor proc = new EncryptedKeyProcessor();
                            proc.handleEncryptedKey((Element) child, cb, crypto, null);

                            return new SAML2KeyInfo(assertion, proc.getDecryptedBytes());
                        } else if (el.equals(new QName(WSConstants.WST_NS, "BinarySecret"))) {
                            Text txt = (Text) child.getFirstChild();
                            return new SAML2KeyInfo(assertion, Base64.decode(txt.getData()));
View Full Code Here

Examples of org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey()

                        }
                        QName el = new QName(child.getNamespaceURI(), child.getLocalName());
                        if (el.equals(WSSecurityEngine.ENCRYPTED_KEY)) {
                           
                            EncryptedKeyProcessor proc = new EncryptedKeyProcessor();
                            proc.handleEncryptedKey((Element)child, cb, crypto, null);
                           
                            return new SAMLKeyInfo(assertion, proc.getDecryptedBytes());
                        } else if (el.equals(new QName(WSConstants.WST_NS, "BinarySecret"))) {
                            Text txt = (Text)child.getFirstChild();
                            return new SAMLKeyInfo(assertion, Base64.decode(txt.getData()));
View Full Code Here

Examples of org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey()

                        }
                        QName el = new QName(child.getNamespaceURI(), child.getLocalName());
                        if(el.equals(WSSecurityEngine.ENCRYPTED_KEY)) {
                           
                            EncryptedKeyProcessor proc = new EncryptedKeyProcessor();
                            proc.handleEncryptedKey((Element)child, cb, crypto, null);
                           
                            return new SAMLKeyInfo(assertion, proc.getDecryptedBytes());
                        } else if(el.equals(new QName(WSConstants.WST_NS, "BinarySecret"))) {
                            Text txt = (Text)child.getFirstChild();
                            return new SAMLKeyInfo(assertion, Base64.decode(txt.getData()));
View Full Code Here

Examples of org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey()

                        }
                        QName el = new QName(child.getNamespaceURI(), child.getLocalName());
                        if (el.equals(WSSecurityEngine.ENCRYPTED_KEY)) {

                            EncryptedKeyProcessor proc = new EncryptedKeyProcessor();
                            proc.handleEncryptedKey((Element) child, cb, crypto, null);

                            return new SAML2KeyInfo(assertion, proc.getDecryptedBytes());
                        } else if (el.equals(new QName(WSConstants.WST_NS, "BinarySecret"))) {
                            Text txt = (Text) child.getFirstChild();
                            return new SAML2KeyInfo(assertion, Base64.decode(txt.getData()));
View Full Code Here

Examples of org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey()

        .item(0);
    encrKeyElem = (Element) kiElem.getElementsByTagNameNS(WSConstants.ENC_NS,
        EncryptionConstants._TAG_ENCRYPTEDKEY).item(0);

    encrKeyProcessor = new EncryptedKeyProcessor();
    encrKeyProcessor.handleEncryptedKey(encrKeyElem, privKey);

    secretKey = WSSecurityUtil.prepareSecretKey(EncryptionConstants.ALGO_ID_BLOCKCIPHER_AES128,
        encrKeyProcessor.getDecryptedBytes());

    cipher = XMLCipher.getInstance();
View Full Code Here

Examples of org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey()

        "KeyInfo").item(0);
    Element encrKeyElem = (Element) kiElem.getElementsByTagNameNS(WSConstants.ENC_NS,
        EncryptionConstants._TAG_ENCRYPTEDKEY).item(0);

    EncryptedKeyProcessor encrKeyProcessor = new EncryptedKeyProcessor();
    encrKeyProcessor.handleEncryptedKey(encrKeyElem, key);

    SecretKey secretKey = WSSecurityUtil.prepareSecretKey(
        EncryptionConstants.ALGO_ID_BLOCKCIPHER_AES128, encrKeyProcessor
            .getDecryptedBytes());
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.