Examples of addCertificate()


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

      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

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

        if (moCertChain != null)
        {
            Document oDoc = new DocumentImpl();
            oKeyInfo = new KeyInfo(oDoc);
            X509Data oData = new X509Data(oDoc);
            oData.addCertificate(moCertChain[0]);
            oKeyInfo.add(oData);
            oAuthority.setKeyInfo(oKeyInfo);
        }

        return oAuthority;
View Full Code Here

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

    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

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

      X509Certificate[] samlCertChain = this.getCertificateChain();

      Document oDoc = new DocumentImpl();
      KeyInfo oKeyInfo = new KeyInfo(oDoc);
      X509Data oData = new X509Data(oDoc);
      oData.addCertificate(samlCertChain[samlCertChain.length - 1]);
      oKeyInfo.add(oData);
      this.samlKeyInfo = DOMUtils.toString(oKeyInfo.getElement(), false, true);
    } catch (Exception oEx) {

      log.warn("Unable to create TrustedServer KeyInfo object for local authorities");
View Full Code Here

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

                        ks.load(is, "password".toCharArray());
                        arr[0] = (X509Certificate)ks.getCertificate("issuercert");
                        Document oDoc = new DocumentImpl();
                        KeyInfo oKeyInfo = new KeyInfo(oDoc);
                        X509Data oData = new X509Data(oDoc);
                        oData.addCertificate(arr[0]);
                        oKeyInfo.add(oData);
                        srv.setKeyInfo(oKeyInfo);
                       
                        srv.setProviderId("@!E459.819D.771.7990!5B62.6F13.7602.5176");
                    } catch (Exception e) {
View Full Code Here

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

    try
    {
      Document oDoc = new DocumentImpl();
      KeyInfo oKeyInfo = new KeyInfo(oDoc);
      X509Data oData = new X509Data(oDoc);
      oData.addCertificate(oCertChain[oCertChain.length - 1]);
      oKeyInfo.add(oData);
      this.keyInfo = DOMUtils.toString(oKeyInfo.getElement(), false, true);
    }
    catch (Exception oEx)
    {
View Full Code Here

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

      X509Certificate[] samlCertChain = this.getCertificateChain();

      Document oDoc = new DocumentImpl();
      KeyInfo oKeyInfo = new KeyInfo(oDoc);
      X509Data oData = new X509Data(oDoc);
      oData.addCertificate(samlCertChain[samlCertChain.length - 1]);
      oKeyInfo.add(oData);
      this.samlKeyInfo = DOMUtils.toString(oKeyInfo.getElement(), false, true);
    } catch (Exception oEx) {

      log.warn("Unable to create TrustedServer KeyInfo object for local authorities");
View Full Code Here

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

     * @throws XMLSecurityException
     */
    public void addKeyInfo(X509Certificate cert) throws XMLSecurityException {
        X509Data x509data = new X509Data(getDocument());

        x509data.addCertificate(cert);
        this.getKeyInfo().add(x509data);
    }

    /**
     * Add this public key to the KeyInfo. This will include the complete key in
View Full Code Here

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

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

    */
   public void addKeyInfo(X509Certificate cert) throws XMLSecurityException {

      X509Data x509data = new X509Data(this._doc);

      x509data.addCertificate(cert);
      this.getKeyInfo().add(x509data);
   }

   /**
    * Add this public key to the KeyInfo. This will include the complete key in
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.