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

Examples of org.apache.xml.security.keys.content.x509.XMLX509IssuerSerial


            "http://www.w3.org/2000/09/xmldsig#rsa-sha1", document, localNames, key
        );
       
        // Add KeyInfo
        KeyInfo keyInfo = sig.getKeyInfo();
        XMLX509IssuerSerial issuerSerial =
            new XMLX509IssuerSerial(sig.getDocument(), cert);
        X509Data x509Data = new X509Data(sig.getDocument());
        x509Data.add(issuerSerial);
        keyInfo.add(x509Data);
       
        // XMLUtils.outputDOM(document, System.out);
View Full Code Here


    @org.junit.Test
    public void testGetIssuerName() throws Exception {
        // Make sure hex encoded value is not escaped (see ...)
        String issuer = "9.99.999=#abc123";
        XMLX509IssuerSerial is =
            new XMLX509IssuerSerial(doc, issuer, 0);
        assertEquals(issuer, is.getIssuerName());
        // System.out.println(is.getIssuerName());
        issuer = "CN=#abc123";
        is = new XMLX509IssuerSerial(doc, issuer, 0);
        assertEquals("CN=\\#abc123", is.getIssuerName());
        // System.out.println(is.getIssuerName());
    }
View Full Code Here

        // Issuer/Serial hint
        ki = new KeyInfo(doc);
        ki.addStorageResolver(storage);
        x509data = new X509Data(doc);
        x509data.add(new XMLX509IssuerSerial(doc, cert.getIssuerX500Principal().getName(), cert.getSerialNumber()));
        ki.add(x509data);
        assertEquals(publicKey, ki.getPublicKey());

        ki.registerInternalKeyResolver(privateKeyResolver);
        assertEquals(privateKey, ki.getPrivateKey());
View Full Code Here

     *
     * @param X509IssuerName
     * @param X509SerialNumber
     */
    public void addIssuerSerial(String X509IssuerName, BigInteger X509SerialNumber) {
        this.add(new XMLX509IssuerSerial(getDocument(), X509IssuerName, X509SerialNumber));
    }
View Full Code Here

     *
     * @param X509IssuerName
     * @param X509SerialNumber
     */
    public void addIssuerSerial(String X509IssuerName, String X509SerialNumber) {
        this.add(new XMLX509IssuerSerial(getDocument(), X509IssuerName, X509SerialNumber));
    }
View Full Code Here

     *
     * @param X509IssuerName
     * @param X509SerialNumber
     */
    public void addIssuerSerial(String X509IssuerName, int X509SerialNumber) {
        this.add(new XMLX509IssuerSerial(getDocument(), X509IssuerName, X509SerialNumber));
    }
View Full Code Here

        Element e =
            XMLUtils.selectDsNode(
                getFirstChild(), Constants._TAG_X509ISSUERSERIAL, i);

        if (e != null) {
            return new XMLX509IssuerSerial(e, this.baseURI);
        }
        return null;
    }
View Full Code Here

        }
        try {
            if (Constants._TAG_X509DATA.equals(elem.getLocalName())) {
                elem = (Element)WSSecurityUtil.findElement(elem, Constants._TAG_X509ISSUERSERIAL, Constants.SignatureSpecNS);
            }
            issuerSerial = new XMLX509IssuerSerial(elem, "");
        } catch (XMLSecurityException e) {
            throw new WSSecurityException(WSSecurityException.SECURITY_TOKEN_UNAVAILABLE,
                    "noToken",
                    new Object[]{"Issuer/Serial data element missing"});
        }
View Full Code Here

                    .getElement(), false);
            wsDocInfo.setBst(bstToken.getElement());
            break;

        case WSConstants.ISSUER_SERIAL:
            XMLX509IssuerSerial data = new XMLX509IssuerSerial(doc, certs[0]);
            X509Data x509Data = new X509Data(doc);
            x509Data.add(data);
            secRef.setX509IssuerSerial(x509Data);
            break;
View Full Code Here

        }
        try {
            if (Constants._TAG_X509DATA.equals(elem.getLocalName())) {
                elem = (Element)WSSecurityUtil.findElement(elem, Constants._TAG_X509ISSUERSERIAL, Constants.SignatureSpecNS);
            }
            issuerSerial = new XMLX509IssuerSerial(elem, "");
        } catch (XMLSecurityException e) {
            throw new WSSecurityException(WSSecurityException.SECURITY_TOKEN_UNAVAILABLE,
                    "noToken",
                    new Object[]{"Issuer/Serial data element missing"});
        }
View Full Code Here

TOP

Related Classes of org.apache.xml.security.keys.content.x509.XMLX509IssuerSerial

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.