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("dsig", "KeyValue", "http://www.w3.org/2000/09/xmldsig#");
            PublicKey key = cert.getPublicKey();
            String pubKeyAlgo = key.getAlgorithm();
            if ("DSA".equalsIgnoreCase(pubKeyAlgo)) {
View Full Code Here


    * @param cert Certificate to be included. This should be the certificate of the key that was used to sign.
    * @throws XMLSecurityException
    */
   public void addKeyInfo(X509Certificate cert) throws XMLSecurityException {

      X509Data x509data = new X509Data(this._doc);

      x509data.addCertificate(cert);
      this.getKeyInfo().add(x509data);
   }
View Full Code Here

     }
      Element e = XMLUtils.selectDsNode(this._constructionElement.getFirstChild(),
                                                Constants._TAG_X509DATA,i);

      if (e != null) {
         return new X509Data(e, this._baseURI);
      }
      return null;
   }
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("dsig", "KeyValue", "http://www.w3.org/2000/09/xmldsig#");
            PublicKey key = cert.getPublicKey();
            String pubKeyAlgo = key.getAlgorithm();
            if ("DSA".equalsIgnoreCase(pubKeyAlgo)) {
View Full Code Here

        writer.writeStartElement("wst", "UseKey", namespace);
        writer.writeStartElement("dsig", "KeyInfo", "http://www.w3.org/2000/09/xmldsig#");
        writer.writeNamespace("dsig", "http://www.w3.org/2000/09/xmldsig#");

        if (useCertificateForConfirmationKeyInfo) {
            X509Data certElem = new X509Data(writer.getDocument());
            certElem.addCertificate(cert);
            writer.getCurrentNode().appendChild(certElem.getElement());
        } else {
            writer.writeStartElement("dsig", "KeyValue", "http://www.w3.org/2000/09/xmldsig#");
            PublicKey key = cert.getPublicKey();
            String pubKeyAlgo = key.getAlgorithm();
            if ("DSA".equalsIgnoreCase(pubKeyAlgo)) {
View Full Code Here

     }
      Element e = XMLUtils.selectDsNode(this._constructionElement.getFirstChild(),
                                                Constants._TAG_X509DATA,i);

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

    * @param cert Certificate to be included. This should be the certificate of the key that was used to sign.
    * @throws XMLSecurityException
    */
   public void addKeyInfo(X509Certificate cert) throws XMLSecurityException {

      X509Data x509data = new X509Data(this._doc);

      x509data.addCertificate(cert);
      this.getKeyInfo().add(x509data);
   }
View Full Code Here

    if (kekKeyName != null) {
      kek = mapKeyName(kekKeyName.getKeyName());
    }
    else {

      X509Data certData = kiek.itemX509Data(0);
      XMLX509Certificate xcert = certData.itemCertificate(0);
      X509Certificate cert = xcert.getX509Certificate();

      if (cert != null) {

        if (cert.getSerialNumber().toString().equals(rsaCertSerialNumber)) {
View Full Code Here

    if (kekKeyName != null) {
      kek = mapKeyName(kekKeyName.getKeyName());
    }
    else {

      X509Data certData = kiek.itemX509Data(0);
      XMLX509Certificate xcert = certData.itemCertificate(0);
      X509Certificate cert = xcert.getX509Certificate();

      if (cert != null) {

        if (cert.getSerialNumber().toString().equals(rsaCertSerialNumber)) {
View Full Code Here

            try
            {
                Document oDoc = new DocumentImpl();
                KeyInfo oKeyInfo = new KeyInfo(oDoc);
                X509Data oData = new X509Data(oDoc);
                oData.addCertificate(oCertChain[oCertChain.length - 1]);
                oKeyInfo.add(oData);
                msKeyInfo =
                    DOMUtils.toString(oKeyInfo.getElement(), false, true);
            }
            catch (Exception oEx)
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.