Examples of addKeyInfo()


Examples of org.apache.xml.security.signature.XMLSignature.addKeyInfo()

      {
         X509Certificate cert =
            (X509Certificate) ks.getCertificate(certificateAlias);

         sig.addKeyInfo(cert);
         sig.addKeyInfo(cert.getPublicKey());
         sig.sign(privateKey);
      }

      FileOutputStream f = new FileOutputStream(signatureFile);
View Full Code Here

Examples of org.apache.xml.security.signature.XMLSignature.addKeyInfo()

      {
         X509Certificate cert =
            (X509Certificate) ks.getCertificate(certificateAlias);

         sig.addKeyInfo(cert);
         sig.addKeyInfo(cert.getPublicKey());
         sig.sign(privateKey);
      }

      FileOutputStream f = new FileOutputStream(signatureFile);
View Full Code Here

Examples of org.apache.xml.security.signature.XMLSignature.addKeyInfo()

      {
         X509Certificate cert =
            (X509Certificate) ks.getCertificate(certificateAlias);

         sig.addKeyInfo(cert);
         sig.addKeyInfo(cert.getPublicKey());
         System.out.println("Start signing");
         sig.sign(privateKey);
         System.out.println("Finished signing");
      }
View Full Code Here

Examples of org.apache.xml.security.signature.XMLSignature.addKeyInfo()

      {
         X509Certificate cert =
            (X509Certificate) ks.getCertificate(certificateAlias);

         sig.addKeyInfo(cert);
         sig.addKeyInfo(cert.getPublicKey());
         System.out.println("Start signing");
         sig.sign(privateKey);
         System.out.println("Finished signing");
      }
View Full Code Here

Examples of org.apache.xml.security.signature.XMLSignature.addKeyInfo()

                                                SignatureURI);
      Transforms transforms = new Transforms(doc);

      transforms.addTransform(Transforms.TRANSFORM_ENVELOPED_SIGNATURE);
      signature.addDocument("", transforms, DigestURI);
      signature.addKeyInfo(pubkey);
      root.appendChild(signature.getElement());
      XMLUtils.addReturnToElement(root);
      signature.sign(privk);

      FileOutputStream fos = new FileOutputStream(f);
View Full Code Here

Examples of org.apache.xml.security.signature.XMLSignature.addKeyInfo()

        } else {
            sig = prepareEnvelopedSignature(doc, id, referenceId, sigAlgo, digestAlgo);
        }
       
        if (this.keyInfoMustBeAvailable) {
            sig.addKeyInfo(issuerCerts[0]);
            sig.addKeyInfo(issuerCerts[0].getPublicKey());
        }
        sig.sign(privateKey);
        return sig.getElement().getOwnerDocument();
    }
View Full Code Here

Examples of org.apache.xml.security.signature.XMLSignature.addKeyInfo()

            sig = prepareEnvelopedSignature(doc, id, referenceId, sigAlgo, digestAlgo);
        }
       
        if (this.keyInfoMustBeAvailable) {
            sig.addKeyInfo(issuerCerts[0]);
            sig.addKeyInfo(issuerCerts[0].getPublicKey());
        }
        sig.sign(privateKey);
        return sig.getElement().getOwnerDocument();
    }
   
View Full Code Here

Examples of org.apache.xml.security.signature.XMLSignature.addKeyInfo()

        } else {
            sig = prepareEnvelopedSignature(doc, id, referenceId, sigAlgo);
        }
       
       
        sig.addKeyInfo(issuerCerts[0]);
        sig.addKeyInfo(issuerCerts[0].getPublicKey());
        sig.sign(privateKey);
        return sig.getElement().getOwnerDocument();
    }
   
View Full Code Here

Examples of org.apache.xml.security.signature.XMLSignature.addKeyInfo()

            sig = prepareEnvelopedSignature(doc, id, referenceId, sigAlgo);
        }
       
       
        sig.addKeyInfo(issuerCerts[0]);
        sig.addKeyInfo(issuerCerts[0].getPublicKey());
        sig.sign(privateKey);
        return sig.getElement().getOwnerDocument();
    }
   
    private XMLSignature prepareEnvelopingSignature(Document doc,
View Full Code Here

Examples of org.apache.xml.security.signature.XMLSignature.addKeyInfo()

                X509Certificate cert = (X509Certificate) ks
                    .getCertificate(certificateAlias);
                if(cert.equals(null)){
                    throw new NullPointerException();
                }
                sig.addKeyInfo(cert);
                sig.addKeyInfo(cert.getPublicKey());

                System.out.println("Start signing");
                sig.sign(privateKey);
                System.out.println("Finished signing");
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.