Signature¶
-
public abstract class
Signature
extends HeaderElement¶ An ebXML
Signature
is aHeaderElement
inHeaderContainer
[ebMSS 4.1.1 and 4.1.3].This class is a partial implementation of the XML-Signature Syntax and Processing / RFC 3275. Please refer to these documents for details.
Author: cyng See also: ` XML-Signature Syntax and Processing <http://www.w3.org/TR/xmldsig-core/>`_
Fields¶
ATTRIBUTE_ALGORITHM¶
CANONICALIZATION_METHOD¶
-
public static final String
CANONICALIZATION_METHOD
¶ Namespace URI of the canonicalization method as specified in Exclusive XML Canonicalization Version 1.0.
DIGEST_ALGORITHM¶
DIGEST_METHOD¶
ELEMENT_CANONICALIZATION_METHOD¶
ELEMENT_DIGEST_METHOD¶
ELEMENT_DIGEST_VALUE¶
ELEMENT_KEY_INFO¶
ELEMENT_OBJECT¶
ELEMENT_REFERENCE¶
ELEMENT_SIGNATURE¶
ELEMENT_SIGNATURE_METHOD¶
ELEMENT_SIGNATURE_VALUE¶
ELEMENT_SIGNED_INFO¶
ELEMENT_TRANSFORM¶
ELEMENT_TRANSFORMS¶
ELEMENT_X509_CERTIFICATE¶
ELEMENT_X509_DATA¶
SIGNATURE_ALGORITHM¶
SIGNATURE_METHOD¶
TRANSFORM_ALGORITHM_ENVELOPED_SIGNATURE¶
TRANSFORM_ALGORITHM_XPATH¶
TRANSFORM_XPATH¶
Constructors¶
Signature¶
-
Signature
(SOAPEnvelope soapEnvelope, String localName, String prefix, String uri)¶ Initializes the
Signature
object using the givenSOAPEnvelope
, local name, namespace prefix and namespace URI.Parameters: - soapEnvelope –
SOAPEnvelope
on which digital signature will be applied. - localName – Local name of the signature element.
- prefix – Namespace prefix of the signature element.
- uri – Namespace URI of the signature element.
Throws: - SOAPException –
- soapEnvelope –
Signature¶
-
Signature
(SOAPEnvelope soapEnvelope, SOAPElement soapElement)¶
Methods¶
addReference¶
newInstance¶
-
static Signature
newInstance
(EbxmlMessage ebxmlMessage)¶ Get a new instance of
Signature
which will be used to sign or verify the givenEbxmlMessage
newInstance¶
-
static Signature
newInstance
(SOAPEnvelope soapEnvelope, SOAPElement soapElement)¶
newInstance¶
-
static Signature
newInstance
(EbxmlMessage ebxmlMessage, SOAPEnvelope soapEnvelope, SOAPElement soapElement)¶
sign¶
sign¶
-
abstract void
sign
(String username, char[] password, String keyStoreLocation, String algorithm)¶ Sign the
EbxmlMessage
with the username and password used to retrieve private key from the keystoreParameters: - username – User name required to open the private key.
- password – Password required to open the private key.
- keyStoreLocation – File location of the keystore.
- algorithm – Name of the algorithm used to sign the message.
Throws:
sign¶
-
abstract void
sign
(String username, char[] password, String keyStoreLocation, String algorithm, String digestAlgo, boolean signEnvelopeOnly)¶ Sign the
EbxmlMessage
with the username and password used to retrieve private key from the keystoreParameters: - username – User name required to open the private key.
- password – Password required to open the private key.
- keyStoreLocation – File location of the keystore.
- algorithm – Name of the algorithm used to sign the message.
- digestAlgo – Name of the algorithm used to make the digest.
- signEnvelopeOnly – whether sign the envelope only.,
Throws:
sign¶
-
abstract void
sign
(String username, char[] password, String keyStoreLocation)¶ Sign the
EbxmlMessage
with the username and password used to retrieve private key from the keystoreParameters: - username – User name required to open the private key.
- password – Password required to open the private key.
- keyStoreLocation – File location of the keystore.
Throws:
sign¶
-
abstract void
sign
(String username, char[] password, String keyStoreLocation, String type, String provider)¶ Sign the
EbxmlMessage
with the username and password used to retrieve private key from the keystore.Parameters: - username – User name required to open the private key.
- password – Password required to open the private key.
- keyStoreLocation – File location of the keystore
- type –
- provider –
Throws:
sign¶
-
abstract void
sign
(java.security.PrivateKey privateKey, java.security.cert.X509Certificate[] certificates)¶ Sign the
EbxmlMessage
using the private key supplied and attach X.509 certificates to the signature.Parameters: - privateKey – Private key used to sign the message.
- certificates – List of certificates to be included in the signature.
Throws:
verify¶
-
abstract boolean
verify
(char[] password, String keyStoreLocation, CertResolver certResolver, DataSource datasource)¶ Verify the message using trusted keystore.
Parameters: - password – Password to open the keystore.
- keyStoreLocation – File location of the key store.
- certResolver – Resolve a certificate chain in order to verify the message. If it is null, the certificate chain is extracted directly from the element in the message.
Throws: Returns: true if the digital signature is valid; false otherwise.
verify¶
-
abstract boolean
verify
(org.w3c.dom.Element documentElement, java.security.PublicKey publicKey)¶ Verify the XML signature of the
EbxmlMessage
Parameters: - documentElement – Document fragment which contains the digital signature.
- publicKey – Public key used to verify the digitall signature.
Throws: Returns: true if digital signature is valid; false otherwise.