Package javax.xml.crypto.dsig.keyinfo

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfo


 
      Certificate[] certificates = keyStore.getCertificateChain(alias);
      //keyInfoElements.add(keyInfoFactory.newX509Data(Arrays.asList(certificates)));
      keyInfoElements.add(keyInfoFactory.newX509Data(Collections.singletonList(certificates[0])));
 
      KeyInfo keyInfo = keyInfoFactory.newKeyInfo(keyInfoElements);
 
      XMLSignature signature = signFactory.newXMLSignature(signedInfo,keyInfo);
 
      Element soapHeader = getFirstChildElement(document.getDocumentElement());
      DOMSignContext signContext = new DOMSignContext(keyPair.getPrivate(),soapHeader);
View Full Code Here


     */
    private KeyValue getKeyValue(
        Element keyInfoElement
    ) throws MarshalException {
        XMLStructure keyInfoStructure = new DOMStructure(keyInfoElement);
        KeyInfo keyInfo = keyInfoFactory.unmarshalKeyInfo(keyInfoStructure);
        List<?> list = keyInfo.getContent();

        for (int i = 0; i < list.size(); i++) {
            XMLStructure xmlStructure = (XMLStructure) list.get(i);
            if (xmlStructure instanceof KeyValue) {
                return (KeyValue)xmlStructure;
View Full Code Here

    // Step 6: Create a KeyInfo object. This step is optional, just as
    // KeyInfo as an element in Signature element is optional.
    KeyInfoFactory kif = fac.getKeyInfoFactory();
    KeyValue kv = kif.newKeyValue(kp.getPublic());
    KeyInfo ki = kif.newKeyInfo(Collections.singletonList(kv));

    // Step 7: Create an XMLSignature object. In JSR-105, the XMLSignature
    // interface models the Signature element of the W3C recommendation.
    XMLSignature signature = fac.newXMLSignature(si, ki, Collections.singletonList(obj), null, null);
View Full Code Here

    // Step 5b: Create a KeyInfo object. This step is optional, just as
    // KeyInfo as an element in Signature element is optional.
    KeyInfoFactory kif = fac.getKeyInfoFactory();
    KeyValue kv = kif.newKeyValue(kp.getPublic());
    KeyInfo ki = kif.newKeyInfo(Collections.singletonList(kv));

    // Step 5c : Create a DOMSignContext and specify the DSA PrivateKey and
    // location of the resulting XMLSignature's parent element.
    DOMSignContext dsc = new DOMSignContext(kp.getPrivate(), doc);
View Full Code Here

    // Step 5b: Create a KeyInfo object. This step is optional, just as
    // KeyInfo as an element in Signature element is optional.
    KeyInfoFactory kif = fac.getKeyInfoFactory();
    KeyValue kv = kif.newKeyValue(kp.getPublic());
    KeyInfo ki = kif.newKeyInfo(Collections.singletonList(kv));

    // Step 5c : Create a DOMSignContext and specify the DSA PrivateKey and
    // location of the resulting XMLSignature's parent element.
    DOMSignContext dsc = new DOMSignContext(kp.getPrivate(), doc.getDocumentElement());
View Full Code Here

            //WSSPolicy keyBinding =(WSSPolicy) signaturePolicy.getKeyBinding();
            KeyInfoFactory keyFactory = getKeyInfoFactory();
           
            DOMStructure domKeyInfo = new DOMStructure(reference.getAsSoapElement());
           
            KeyInfo keyInfo = keyFactory.newKeyInfo(Collections.singletonList(domKeyInfo));
            return keyInfo;
           
        }
       
        return null;
View Full Code Here

            KeyInfoFactory keyFactory = getKeyInfoFactory();
            javax.xml.crypto.dsig.keyinfo.KeyName keyName = keyFactory.newKeyName(KeyName);
            java.util.List list = new java.util.ArrayList();
            list.add(keyName);
           
            KeyInfo keyInfo = keyFactory.newKeyInfo(list);
           
            return keyInfo;
           
        }
       
View Full Code Here

           
            Key signingKey = null;
            Node nextSibling =  null;
            //TODO :: Creation of WSSPolicyConsumerImpl every time.
            WSSPolicyConsumerImpl dsigHelper = WSSPolicyConsumerImpl.getInstance();
            KeyInfo keyInfo = null;
            SecurityHeader securityHeader = secureMessage.findOrCreateSecurityHeader();
           
            SignaturePolicy.FeatureBinding featureBinding =
                    (SignaturePolicy.FeatureBinding)signaturePolicy.getFeatureBinding();
            AlgorithmSuite algSuite = context.getAlgorithmSuite();
View Full Code Here

    private static KeyInfo prepareForSymmetricKeySignature(FilterProcessingContext context,
            WSSPolicy keyBinding, Key originalKey, SignaturePolicy signaturePolicy, Node[] nxtSiblingContainer, AuthenticationTokenPolicy.X509CertificateBinding certInfo, DerivedKeyToken dkt)
            throws XWSSecurityException {
       
        Node nextSibling = null;
        KeyInfo keyInfo = null;
       
        //depending on the ref type handle an X509Token
        //create an EK with keyInfo pointing to the X509
        String keyEncAlgo = XMLCipher.RSA_v1dot5;  //<--Harcoding of Algo
        if (context.getAlgorithmSuite() != null) {
View Full Code Here

            SignaturePolicy signaturePolicy,
            AuthenticationTokenPolicy.X509CertificateBinding certInfo,
            Node[] nxtSiblingContainer) throws XWSSecurityException{
       
        Node nextSibling = null;
        KeyInfo keyInfo = null;
        SecurableSoapMessage secureMessage = context.getSecurableSoapMessage();
        SecurityHeader securityHeader = secureMessage.findOrCreateSecurityHeader();
        WSSPolicyConsumerImpl dsigHelper = WSSPolicyConsumerImpl.getInstance();
       
        HashMap tokenCache = context.getTokenCache();
View Full Code Here

TOP

Related Classes of javax.xml.crypto.dsig.keyinfo.KeyInfo

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.