public final class SignatureManager
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
signDocument(org.w3c.dom.Document msgAsDocument)
Signs the given xml document usign the default keystore.
|
static void |
signDocument(org.w3c.dom.Document msgAsDocument,
java.security.PrivateKey privateKey,
java.security.cert.X509Certificate cert)
Signs the given xml document usign the given private key and certificate.
|
static void |
signDocument(org.w3c.dom.Document msgAsDocument,
java.security.interfaces.RSAPrivateKey privateKey,
java.security.cert.X509Certificate cert)
Signs the given xml document usign the given private key and certificate.
|
static void |
signString(java.lang.StringBuilder msgAsString)
Signs the given xml document expressed as String (StringBuilder) using the default keystore.
|
static void |
signString(java.lang.StringBuilder msgAsString,
java.security.PrivateKey privateKey,
java.security.cert.X509Certificate cert)
Signs the given xml document expressed as String (StringBuilder) usign the given private key and certificate.
|
static java.security.cert.X509Certificate |
verifyDocument(org.w3c.dom.Document msgAsDocument)
Verifies the signature of the given signed document.
|
static java.security.cert.X509Certificate |
verifyString(java.lang.StringBuilder msgAsString)
Verifies the signature of the given signed document expressed as String (StringBuilder).
|
public static java.security.cert.X509Certificate verifyString(java.lang.StringBuilder msgAsString)
throws SignatureVerificationException,
SignatureSyntaxException
msgAsString - The document to be validated.null if other kind of certificate was used (RSA, DSA).SignatureVerificationException - If the document cannot be validated or if its signature is invalid.SignatureSyntaxException - If the given signature has an invalid structure (syntaxis)verifyString(StringBuilder)public static java.security.cert.X509Certificate verifyDocument(org.w3c.dom.Document msgAsDocument)
throws SignatureVerificationException,
SignatureSyntaxException
msgAsDocument - The document to be validated.null if other kind of certificate was used (RSA, DSA).SignatureVerificationException - If the document cannot be validated or if its signature is invalid.SignatureSyntaxException - If the given signature has an invalid structure (syntaxis)verifyString(StringBuilder)public static void signDocument(org.w3c.dom.Document msgAsDocument,
java.security.interfaces.RSAPrivateKey privateKey,
java.security.cert.X509Certificate cert)
throws SignatureManagerException
msgAsDocument - The document to be signed, the result of the process will be returned in this parameter.privateKey - The private key to be used for signature.cert - The certificate to be used for signature.SignatureManagerException - If it's impossible to sign the document.signString(StringBuilder, PrivateKey, X509Certificate)public static void signDocument(org.w3c.dom.Document msgAsDocument)
throws SignatureManagerException
msgAsDocument - The document to be signed, the result of the process will be returned in this parameter.SignatureManagerException - If it's impossible to sign the document.signString(StringBuilder)public static void signString(java.lang.StringBuilder msgAsString)
throws SignatureManagerException
msgAsString - The document to be signed, the result of the process will be returned in this parameter.SignatureManagerException - If it's impossible to sign the document.signDocument(Document)public static void signString(java.lang.StringBuilder msgAsString,
java.security.PrivateKey privateKey,
java.security.cert.X509Certificate cert)
throws SignatureManagerException
msgAsString - The document to be signed, the result of the process will be returned in this parameter.privateKey - The private key to be used for signature.cert - The certificate to be used for signature.SignatureManagerException - If it's impossible to sign the document.signDocument(Document, RSAPrivateKey, X509Certificate)public static void signDocument(org.w3c.dom.Document msgAsDocument,
java.security.PrivateKey privateKey,
java.security.cert.X509Certificate cert)
throws SignatureManagerException
msgAsDocument - The document to be signed, the result of the process will be returned in this parameter.privateKey - The private key to be used for signature.cert - The certificate to be used for signature.SignatureManagerException - If it's impossible to sign the document.signString(StringBuilder, PrivateKey, X509Certificate)