Package com.itextpdf.text.pdf.security
Class MakeXmlSignature
- java.lang.Object
-
- com.itextpdf.text.pdf.security.MakeXmlSignature
-
public class MakeXmlSignature extends java.lang.Object
Class that signs your XML.
-
-
Constructor Summary
Constructors Constructor Description MakeXmlSignature()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
signXades(XmlSignatureAppearance sap, ExternalSignature externalSignature, java.security.cert.Certificate[] chain, boolean includeSignaturePolicy)
Signs the xml with XAdES BES using the enveloped mode, with optional xpath transform (see XmlSignatureAppearance).static void
signXadesBes(XmlSignatureAppearance sap, ExternalSignature externalSignature, java.security.cert.Certificate[] chain)
Signs the xml with XAdES BES using the enveloped mode, with optional xpath transform (see XmlSignatureAppearance).static void
signXadesEpes(XmlSignatureAppearance sap, ExternalSignature externalSignature, java.security.cert.Certificate[] chain)
Signs the xml with XAdES BES using the enveloped mode, with optional xpath transform (see XmlSignatureAppearance).static void
signXmlDSig(XmlSignatureAppearance sap, ExternalSignature externalSignature, java.security.cert.Certificate[] chain)
Signs the xml with XmlDSig using the enveloped mode, with optional xpath transform (see XmlSignatureAppearance).static void
signXmlDSig(XmlSignatureAppearance sap, ExternalSignature externalSignature, java.security.PublicKey publicKey)
Signs the xml with XmlDSig using the enveloped mode, with optional xpath transform (see XmlSignatureAppearance).static void
signXmlDSig(XmlSignatureAppearance sap, ExternalSignature externalSignature, javax.xml.crypto.dsig.keyinfo.KeyInfo keyInfo)
Signs the xml with XmlDSig using the enveloped mode, with optional xpath transform (see XmlSignatureAppearance).
-
-
-
Method Detail
-
signXmlDSig
public static void signXmlDSig(XmlSignatureAppearance sap, ExternalSignature externalSignature, javax.xml.crypto.dsig.keyinfo.KeyInfo keyInfo) throws java.security.GeneralSecurityException, java.io.IOException, DocumentException
Signs the xml with XmlDSig using the enveloped mode, with optional xpath transform (see XmlSignatureAppearance).- Parameters:
sap
- the XmlSignatureAppearanceexternalSignature
- the interface providing the actual signingkeyInfo
- KeyInfo for verification- Throws:
java.security.GeneralSecurityException
java.io.IOException
DocumentException
-
signXmlDSig
public static void signXmlDSig(XmlSignatureAppearance sap, ExternalSignature externalSignature, java.security.cert.Certificate[] chain) throws DocumentException, java.security.GeneralSecurityException, java.io.IOException
Signs the xml with XmlDSig using the enveloped mode, with optional xpath transform (see XmlSignatureAppearance).- Parameters:
sap
- the XmlSignatureAppearanceexternalSignature
- the interface providing the actual signingchain
- the certificate chain- Throws:
java.security.GeneralSecurityException
java.io.IOException
DocumentException
-
signXmlDSig
public static void signXmlDSig(XmlSignatureAppearance sap, ExternalSignature externalSignature, java.security.PublicKey publicKey) throws java.security.GeneralSecurityException, DocumentException, java.io.IOException
Signs the xml with XmlDSig using the enveloped mode, with optional xpath transform (see XmlSignatureAppearance).- Parameters:
sap
- the XmlSignatureAppearanceexternalSignature
- the interface providing the actual signingpublicKey
- PublicKey for verification- Throws:
java.security.GeneralSecurityException
java.io.IOException
DocumentException
-
signXades
public static void signXades(XmlSignatureAppearance sap, ExternalSignature externalSignature, java.security.cert.Certificate[] chain, boolean includeSignaturePolicy) throws java.security.GeneralSecurityException, DocumentException, java.io.IOException
Signs the xml with XAdES BES using the enveloped mode, with optional xpath transform (see XmlSignatureAppearance).- Parameters:
sap
- the XmlSignatureAppearanceexternalSignature
- the interface providing the actual signingchain
- the certificate chainincludeSignaturePolicy
- if true SignaturePolicyIdentifier will be included (XAdES-EPES)- Throws:
java.security.GeneralSecurityException
java.io.IOException
DocumentException
-
signXadesBes
public static void signXadesBes(XmlSignatureAppearance sap, ExternalSignature externalSignature, java.security.cert.Certificate[] chain) throws java.security.GeneralSecurityException, DocumentException, java.io.IOException
Signs the xml with XAdES BES using the enveloped mode, with optional xpath transform (see XmlSignatureAppearance).- Parameters:
sap
- the XmlSignatureAppearanceexternalSignature
- the interface providing the actual signingchain
- the certificate chain- Throws:
java.security.GeneralSecurityException
java.io.IOException
DocumentException
-
signXadesEpes
public static void signXadesEpes(XmlSignatureAppearance sap, ExternalSignature externalSignature, java.security.cert.Certificate[] chain) throws java.security.GeneralSecurityException, DocumentException, java.io.IOException
Signs the xml with XAdES BES using the enveloped mode, with optional xpath transform (see XmlSignatureAppearance).- Parameters:
sap
- the XmlSignatureAppearanceexternalSignature
- the interface providing the actual signingchain
- the certificate chain- Throws:
java.security.GeneralSecurityException
java.io.IOException
DocumentException
-
-