Examples of newKeyInfo()


Examples of javax.xml.crypto.dsig.keyinfo.KeyInfoFactory.newKeyInfo()

        XMLStructure structure = new DOMStructure(secRef.getElement());
        wsDocInfo.addTokenElement(secRef.getElement(), false);

        KeyInfoFactory keyInfoFactory = signatureFactory.getKeyInfoFactory();
        keyInfo =
            keyInfoFactory.newKeyInfo(
                java.util.Collections.singletonList(structure), keyInfoUri
            );

        wsDocInfo.addTokenElement(samlToken, false);
    }
View Full Code Here

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfoFactory.newKeyInfo()

        this.signedInfo = this.xmlSignatureFactory.newSignedInfo(canonicalizationMethod, signatureMethod, Collections.singletonList(reference));

        KeyInfoFactory keyInfoFactory = this.xmlSignatureFactory.getKeyInfoFactory();
        KeyValue keyValue = keyInfoFactory.newKeyValue(publicKey);
        this.keyInfo = keyInfoFactory.newKeyInfo(Collections.singletonList(keyValue));

        ByteArrayInputStream inputStream = new ByteArrayInputStream(currentData);

        Document document = this.documentBuilderFactory.newDocumentBuilder().parse(inputStream);
        DOMSignContext signContext = new DOMSignContext(privateKey, document.getDocumentElement());
View Full Code Here

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfoFactory.newKeyInfo()

       
        XMLStructure structure = new DOMStructure(secRef.getElement());
        wsDocInfo.addTokenElement(secRef.getElement(), false);
        KeyInfoFactory keyInfoFactory = signatureFactory.getKeyInfoFactory();
        keyInfo =
            keyInfoFactory.newKeyInfo(
                java.util.Collections.singletonList(structure), keyInfoUri
            );
       
    }
   
View Full Code Here

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfoFactory.newKeyInfo()

               
                try {
                    KeyInfoFactory keyInfoFactory = signatureFactory.getKeyInfoFactory();
                    KeyValue keyValue = keyInfoFactory.newKeyValue(publicKey);
                    keyInfo =
                        keyInfoFactory.newKeyInfo(
                            java.util.Collections.singletonList(keyValue), keyInfoUri
                        );
                } catch (java.security.KeyException ex) {
                    LOG.error("", ex);
                    throw new WSSecurityException(
View Full Code Here

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfoFactory.newKeyInfo()

        if (keyIdentifierType != WSConstants.KEY_VALUE) {
            XMLStructure structure = new DOMStructure(secRef.getElement());
            wsDocInfo.addTokenElement(secRef.getElement(), false);
            KeyInfoFactory keyInfoFactory = signatureFactory.getKeyInfoFactory();
            keyInfo =
                keyInfoFactory.newKeyInfo(
                    java.util.Collections.singletonList(structure), keyInfoUri
                );
        }
    }
   
View Full Code Here

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfoFactory.newKeyInfo()

public class Marshal {

    public static void main(String[] args) throws Exception {
        KeyInfoFactory fac = KeyInfoFactory.getInstance();
        KeyInfo ki = fac.newKeyInfo
            (Collections.singletonList(fac.newKeyName("foo")), "keyid");
        try {
            ki.marshal(null, null);
            throw new Exception("Should raise a NullPointerException");
        } catch (NullPointerException npe) {}
View Full Code Here

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfoFactory.newKeyInfo()

        KeyInfo keyInfo = null;
        KeyValue keyValue = null;
        //Just with public key
        if(publicKey != null){
            keyValue = keyInfoFactory.newKeyValue(publicKey);
            keyInfo = keyInfoFactory.newKeyInfo(Collections.singletonList(keyValue));
        }
        if(x509Certificate != null){
            List x509list = new ArrayList();

            x509list.add(x509Certificate);
View Full Code Here

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfoFactory.newKeyInfo()

            items.add(x509Data);
            if(keyValue != null){
                items.add(keyValue);
            }
            keyInfo = keyInfoFactory.newKeyInfo(items);
        }
        return keyInfo;
    }
}
View Full Code Here

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfoFactory.newKeyInfo()

        this.signedInfo = this.xmlSignatureFactory.newSignedInfo(canonicalizationMethod, signatureMethod, Collections.singletonList(reference));

        KeyInfoFactory keyInfoFactory = this.xmlSignatureFactory.getKeyInfoFactory();
        KeyValue keyValue = keyInfoFactory.newKeyValue(publicKey);
        this.keyInfo = keyInfoFactory.newKeyInfo(Collections.singletonList(keyValue));

        ByteArrayInputStream inputStream = new ByteArrayInputStream(currentData);

        Document document = this.documentBuilderFactory.newDocumentBuilder().parse(inputStream);
        DOMSignContext signContext = new DOMSignContext(privateKey, document.getDocumentElement());
View Full Code Here

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfoFactory.newKeyInfo()

            //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
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.