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

Examples of org.apache.xml.security.keys.content.X509Data


        String useCertStr = (String)getProperty(SecurityConstants.STS_TOKEN_USE_CERT_FOR_KEYINFO);
        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();
            if ("DSA".equalsIgnoreCase(pubKeyAlgo)) {
View Full Code Here


        String useCertStr = (String)getProperty(SecurityConstants.STS_TOKEN_USE_CERT_FOR_KEYINFO);
        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();
            if ("DSA".equalsIgnoreCase(pubKeyAlgo)) {
View Full Code Here

        String useCertStr = (String)getProperty(SecurityConstants.STS_TOKEN_USE_CERT_FOR_KEYINFO);
        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();
            if ("DSA".equalsIgnoreCase(pubKeyAlgo)) {
View Full Code Here

        abstractType.setKeyInfo(keyInfo);
    }

    private void addX509Certificate(X509Certificate cert, KeyInfo keyInfo) {

        X509Data data = new X509Data(doc);
        try {
            data.addCertificate(cert);
        } catch (XMLSecurityException se) {
            throw new RuntimeException(
                    "Adding the X509Certificate to X509Data object failed", se);
        }
        keyInfo.add(data);
View Full Code Here

        KeyInfo ki = new KeyInfo(doc);

        doc.appendChild(ki.getElement());

        X509Certificate cert = (X509Certificate) ks.getCertificate("kiss");
        X509Data x509Data = new X509Data(doc);
        x509Data.addCertificate(cert);
        ki.add(x509Data);

        ByteArrayOutputStream bos = new ByteArrayOutputStream();

View Full Code Here

        doc.appendChild(ki.getElement());

        X509Certificate cert1 = (X509Certificate) ks1.getCertificate("kiss");

        X509Data x509Data = new X509Data(doc);
        x509Data.addCertificate(cert1);

        ki.add(x509Data);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        XKMSUtil.outputDOM(doc, bos);
View Full Code Here

        doc.appendChild(ki.getElement());

        X509Certificate cert1 = (X509Certificate) ks1.getCertificate("kiss");
        X509Certificate cert2 = (X509Certificate) ks2.getCertificate("kiss2");

        X509Data x509Data = new X509Data(doc);
        x509Data.addCertificate(cert1);
        x509Data.addCertificate(cert2);
        ki.add(x509Data);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        XKMSUtil.outputDOM(doc, bos);

        XMLStreamReader reader = XMLInputFactory.newInstance()
View Full Code Here

            if (keyValue != null) {
                keyInfo.addKeyValue(keyValue);
            }
           
            if (certValue != null) {
                X509Data data = new X509Data(doc);
                try {
                    data.addCertificate(certValue);
                    keyInfo.add(data);
                } catch (XMLSecurityException ex) {
                    throw new XKMSException(ex);
                }
            }
View Full Code Here

                    X509Certificate[] certs = null;
                    try {
                        KeyInfo ki = new KeyInfo(e, null);

                        if (ki.containsX509Data()) {
                            X509Data data = ki.itemX509Data(0);
                            XMLX509Certificate certElem = null;
                            if (data != null && data.containsCertificate()) {
                                certElem = data.itemCertificate(0);
                            }
                            if (certElem != null) {
                                X509Certificate cert = certElem.getX509Certificate();
                                certs = new X509Certificate[1];
                                certs[0] = cert;
View Full Code Here

        X509Certificate[] certs = null;
        try {
            KeyInfo ki = new KeyInfo(e, null);

            if (ki.containsX509Data()) {
                X509Data data = ki.itemX509Data(0);
                XMLX509Certificate certElem = null;
                if (data != null && data.containsCertificate()) {
                    certElem = data.itemCertificate(0);
                }
                if (certElem != null) {
                    X509Certificate cert = certElem.getX509Certificate();
                    certs = new X509Certificate[1];
                    certs[0] = cert;
View Full Code Here

TOP

Related Classes of org.apache.xml.security.keys.content.X509Data

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.