Package org.apache.xml.security.keys.content

Examples of org.apache.xml.security.keys.content.X509Data.addCertificate()


        if (useCertStr != null) {
            useCert = Boolean.parseBoolean(useCertStr);
        }
        if (useCert) {
            X509Data certElem = new X509Data(writer.getDocument());
            certElem.addCertificate(cert);
            writer.getCurrentNode().appendChild(certElem.getElement());
        } else {
            writer.writeStartElement("ds", "KeyValue", "http://www.w3.org/2000/09/xmldsig#");
            PublicKey key = cert.getPublicKey();
            String pubKeyAlgo = key.getAlgorithm();
View Full Code Here


        KeyInfo keyInfo = xmlSignature.getKeyInfo();
        X509Data x509Data = new X509Data(document);
        Certificate[] certificateChain = privateKeyEntry.getCertificateChain();
        for (int certIdx = 0; certIdx < certificateChain.length; certIdx++) {
            Certificate certificate = certificateChain[certIdx];
            x509Data.addCertificate((X509Certificate) certificate);
        }
        keyInfo.add(x509Data);
       
        PrivateKey privateKey = privateKeyEntry.getPrivateKey();
        xmlSignature.sign(privateKey);
View Full Code Here

        if (useCertStr != null) {
            useCert = Boolean.parseBoolean(useCertStr);
        }
        if (useCert) {
            X509Data certElem = new X509Data(writer.getDocument());
            certElem.addCertificate(cert);
            writer.getCurrentNode().appendChild(certElem.getElement());
        } else {
            writer.writeStartElement("ds", "KeyValue", "http://www.w3.org/2000/09/xmldsig#");
            PublicKey key = cert.getPublicKey();
            String pubKeyAlgo = key.getAlgorithm();
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.