<ds:Signature> elements.
This is the main class that deals with creating and verifying signatures.
There are 2 types of constructors for this class. The ones that take a document, baseURI and 1 or more Java Objects. This is mostly used for signing purposes. The other constructor is the one that takes a DOM Element and a baseURI. This is used mostly with for verifying, when you have a SignatureElement. There are a few different types of methods:
| Modifier and Type | Field and Description |
|---|---|
| public static final String | ALGO_ID_MAC_HMAC_NOT_RECOMMENDED_MD5
HMAC - NOT Recommended HMAC-MD5 |
| public static final String | ALGO_ID_MAC_HMAC_RIPEMD160
HMAC - Optional HMAC-RIPEMD160 |
| public static final String | ALGO_ID_MAC_HMAC_SHA1
MAC - Required HMAC-SHA1 |
| public static final String | ALGO_ID_MAC_HMAC_SHA224
HMAC - Optional HMAC-SHA2224 |
| public static final String | ALGO_ID_MAC_HMAC_SHA256
HMAC - Optional HMAC-SHA256 |
| public static final String | ALGO_ID_MAC_HMAC_SHA384
HMAC - Optional HMAC-SHA284 |
| public static final String | ALGO_ID_MAC_HMAC_SHA512
HMAC - Optional HMAC-SHA512 |
| public static final String | ALGO_ID_SIGNATURE_DSA
Signature - Required DSAwithSHA1 (DSS) |
| public static final String | ALGO_ID_SIGNATURE_DSA_SHA256
Signature - Optional DSAwithSHA256 |
| public static final String | ALGO_ID_SIGNATURE_ECDSA_RIPEMD160
Signature - Optional ECDSAwithRIPEMD160 |
| public static final String | ALGO_ID_SIGNATURE_ECDSA_SHA1
Signature - Optional ECDSAwithSHA1 |
| public static final String | ALGO_ID_SIGNATURE_ECDSA_SHA224
Signature - Optional ECDSAwithSHA224 |
| public static final String | ALGO_ID_SIGNATURE_ECDSA_SHA256
Signature - Optional ECDSAwithSHA256 |
| public static final String | ALGO_ID_SIGNATURE_ECDSA_SHA384
Signature - Optional ECDSAwithSHA384 |
| public static final String | ALGO_ID_SIGNATURE_ECDSA_SHA3_224
Signature - SHA3-224withECDSA |
| public static final String | ALGO_ID_SIGNATURE_ECDSA_SHA3_256
Signature - SHA3-256withECDSA |
| public static final String | ALGO_ID_SIGNATURE_ECDSA_SHA3_384
Signature - SHA3-384withECDSA |
| public static final String | ALGO_ID_SIGNATURE_ECDSA_SHA3_512
Signature - SHA3-512withECDSA |
| public static final String | ALGO_ID_SIGNATURE_ECDSA_SHA512
Signature - Optional ECDSAwithSHA512 |
| public static final String | ALGO_ID_SIGNATURE_EDDSA_ED25519
Signature - EDDSA ED25519 |
| public static final String | ALGO_ID_SIGNATURE_EDDSA_ED448
Signature - EDDSA ED448 |
| public static final String | ALGO_ID_SIGNATURE_NOT_RECOMMENDED_RSA_MD5
Signature - NOT Recommended RSAwithMD5 |
| public static final String | ALGO_ID_SIGNATURE_RSA
Signature - Recommended RSAwithSHA1 |
| public static final String | ALGO_ID_SIGNATURE_RSA_PSS
Signature - Optional RSASSA-PSS |
| public static final String | ALGO_ID_SIGNATURE_RSA_RIPEMD160
Signature - Optional RSAwithRIPEMD160 |
| public static final String | ALGO_ID_SIGNATURE_RSA_SHA1
Signature - Recommended RSAwithSHA1 |
| public static final String | ALGO_ID_SIGNATURE_RSA_SHA1_MGF1
Signature - Optional RSAwithSHA1andMGF1 |
| public static final String | ALGO_ID_SIGNATURE_RSA_SHA224
Signature - Optional RSAwithSHA224 |
| public static final String | ALGO_ID_SIGNATURE_RSA_SHA224_MGF1
Signature - Optional RSAwithSHA224andMGF1 |
| public static final String | ALGO_ID_SIGNATURE_RSA_SHA256
Signature - Optional RSAwithSHA256 |
| public static final String | ALGO_ID_SIGNATURE_RSA_SHA256_MGF1
Signature - Optional RSAwithSHA256andMGF1 |
| public static final String | ALGO_ID_SIGNATURE_RSA_SHA384
Signature - Optional RSAwithSHA384 |
| public static final String | ALGO_ID_SIGNATURE_RSA_SHA384_MGF1
Signature - Optional RSAwithSHA384andMGF1 |
| public static final String | ALGO_ID_SIGNATURE_RSA_SHA3_224_MGF1
Signature - Optional RSAwithSHA3_224andMGF1 |
| public static final String | ALGO_ID_SIGNATURE_RSA_SHA3_256_MGF1
Signature - Optional RSAwithSHA3_256andMGF1 |
| public static final String | ALGO_ID_SIGNATURE_RSA_SHA3_384_MGF1
Signature - Optional RSAwithSHA3_384andMGF1 |
| public static final String | ALGO_ID_SIGNATURE_RSA_SHA3_512_MGF1
Signature - Optional RSAwithSHA3_512andMGF1 |
| public static final String | ALGO_ID_SIGNATURE_RSA_SHA512
Signature - Optional RSAwithSHA512 |
| public static final String | ALGO_ID_SIGNATURE_RSA_SHA512_MGF1
Signature - Optional RSAwithSHA512andMGF1 |
| private boolean | followManifestsDuringValidation
Checking the digests in References in a Signature are mandatory, but for References inside a Manifest it is application specific. |
| private KeyInfo | keyInfo
ds:Signature.ds:KeyInfo |
| private static final Logger | |
| private static final int | |
| private static final int | |
| private Element | |
| private final SignedInfo | signedInfo
ds:Signature.ds:SignedInfo element |
| private int |
| Access | Constructor and Description |
|---|---|
| public | XMLSignature(Document
Document in which the signature will be appended after creation. doc, String URI to be used as context for all relative URIs. baseURI, String signature algorithm to use. signatureMethodURI)This creates a new |
| public | XMLSignature(Document
Document in which the signature will be appended after creation. doc, String URI to be used as context for all relative URIs. baseURI, String signature algorithm to use. signatureMethodURI, Provider security provider to use. provider)This creates a new |
| public | XMLSignature(Document
Document in which the signature will be appended after creation. doc, String URI to be used as context for all relative URIs. baseURI, String the Signature method to be used. signatureMethodURI, int hmacOutputLength)Constructor XMLSignature |
| public | XMLSignature(Document
Document in which the signature will be appended after creation. doc, String URI to be used as context for all relative URIs. baseURI, String the Signature method to be used. signatureMethodURI, int hmacOutputLength, Provider security provider to use. provider)Constructor XMLSignature |
| public | XMLSignature(Document
Document in which the signature will be appended after creation. doc, String URI to be used as context for all relative URIs. baseURI, String the Signature method to be used. signatureMethodURI, String the canonicalization algorithm to be used to c14nize the SignedInfo element. canonicalizationMethodURI)Constructor XMLSignature |
| public | XMLSignature(Document
Document in which the signature will be appended after creation. doc, String URI to be used as context for all relative URIs. baseURI, String the Signature method to be used. signatureMethodURI, String the canonicalization algorithm to be used to c14nize the SignedInfo element. canonicalizationMethodURI, Provider security provider to use. provider)Constructor XMLSignature |
| public | XMLSignature(Document
Document in which the signature will be appended after creation. doc, String URI to be used as context for all relative URIs. baseURI, String the Signature method to be used. signatureMethodURI, int hmacOutputLength, String the canonicalization algorithm to be used to c14nize the SignedInfo element. canonicalizationMethodURI)Constructor XMLSignature |
| public | XMLSignature(Document
Document in which the signature will be appended after creation. doc, String URI to be used as context for all relative URIs. baseURI, String the Signature method to be used. signatureMethodURI, int hmacOutputLength, String the canonicalization algorithm to be used to c14nize the SignedInfo element. canonicalizationMethodURI, Provider security provider to use. provider, AlgorithmParameterSpec spec)Constructor XMLSignature |
| public | XMLSignature(Document doc, String baseURI, Element signatureMethodElem, Element canonicalizationMethodElem)
Creates a XMLSignature in a Document |
| public | |
| public | XMLSignature(Element
ds:Signature element that contains the whole signature element, String URI to be prepended to all relative URIs baseURI)This will parse the element and construct the Java Objects. |
| public | XMLSignature(Element
ds:Signature element that contains the whole signature element, String URI to be prepended to all relative URIs baseURI, Provider security provider to use provider)This will parse the element and construct the Java Objects. |
| public | XMLSignature(Element
ds:Signature element that contains the whole signature element, String URI to be prepended to all relative URIs baseURI, boolean whether secure secureValidation is enabled or not secureValidation)This will parse the element and construct the Java Objects. |
| public | XMLSignature(Element
ds:Signature element that contains the whole signature element, String URI to be prepended to all relative URIs baseURI, boolean whether secure secureValidation is enabled or not secureValidation, Provider security provider to use provider)This will parse the element and construct the Java Objects. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addDocument(String
URI of the resource to be signed. Can be null in
which case the dereferencing is application specific. Can be "" in which
it's the parent node (or parent document?). There can only be one "" in
each signature. referenceURI, Transforms Optional list of transformations to be done before digesting trans, String Mandatory URI of the digesting algorithm to use. digestURI, String Optional id attribute for this Reference referenceId, String Optional mimetype for the URI referenceType)Add a Reference with full parameters to this Signature |
| public void | addDocument(String
URI according to the XML Signature specification. referenceURI, Transforms List of transformations to be applied. trans, String URI of the digest algorithm to be used. digestURI)This method is a proxy method for the |
| public void | addDocument(String
URI according to the XML Signature specification. referenceURI, Transforms List of transformations to be applied. trans)Adds a Reference with just the URI and the transforms. |
| public void | addDocument(String
URI according to the XML Signature specification. referenceURI)Add a Reference with just this URI. |
| public void | addKeyInfo(X509Certificate
Certificate to be included. This should be the certificate of
the key that was used to sign. cert)Add an X509 Certificate to the KeyInfo. |
| public void | |
| public void | addResourceResolver(ResourceResolverSpi resolver)
Adds a |
| public void | appendObject(ObjectContainer
ds:Object to be appended. object)Appends an Object (not a |
| public boolean | Returns: true if the signature is valid, false otherwiseCertificate that contains the public key part of the keypair
that was used to sign. cert)Extracts the public key from the certificate and verifies if the signature is valid by re-digesting all References, comparing those against the stored DigestValues and then checking to see if the Signatures match on the SignedInfo. |
| public boolean | Returns: true if the signature is valid, false otherwisejava. part of the keypair or
javax. that was used to signVerifies if the signature is valid by redigesting all References, comparing those against the stored DigestValues and then checking to see if the Signatures match on the SignedInfo. |
| public SecretKey | Returns: the secret key created.Proxy method for |
| public String | Returns: Constants._TAG_SIGNATUREImplements abstract com. Get the local name of this element |
| public String | |
| public KeyInfo | |
| public ObjectContainer | Returns: theith ds:Object child of the signature
or null if no such ds:Object element exists.Returns the |
| public int | Returns: the number of allds:Object elements.Returns the number of all |
| public byte[] | Returns: the value of the SignatureValue element.Returns the octet value of the SignatureValue element. |
| public SignedInfo | Returns: the completely parsedSignedInfo object.Returns the completely parsed |
| public void | setFollowNestedManifests(boolean followManifests)
Signal whether Manifest should be automatically validated. |
| public void | |
| private void | setSignatureValueElement(byte[]
bytes to be used by SignatureValue before Base64 encoding bytes)Base64 encodes and sets the bytes as the content of the SignatureValue Node. |
| public void | sign(Key
the signingKey)java. or
javax. that is used to sign.Digests all References in the SignedInfo, calculates the signature value and sets it in the SignatureValue Element. |
| ALGO_ID_MAC_HMAC_NOT_RECOMMENDED_MD5 | back to summary |
|---|---|
| public static final String ALGO_ID_MAC_HMAC_NOT_RECOMMENDED_MD5 HMAC - NOT Recommended HMAC-MD5 | |
| ALGO_ID_MAC_HMAC_RIPEMD160 | back to summary |
|---|---|
| public static final String ALGO_ID_MAC_HMAC_RIPEMD160 HMAC - Optional HMAC-RIPEMD160 | |
| ALGO_ID_MAC_HMAC_SHA1 | back to summary |
|---|---|
| public static final String ALGO_ID_MAC_HMAC_SHA1 MAC - Required HMAC-SHA1 | |
| ALGO_ID_MAC_HMAC_SHA224 | back to summary |
|---|---|
| public static final String ALGO_ID_MAC_HMAC_SHA224 HMAC - Optional HMAC-SHA2224 | |
| ALGO_ID_MAC_HMAC_SHA256 | back to summary |
|---|---|
| public static final String ALGO_ID_MAC_HMAC_SHA256 HMAC - Optional HMAC-SHA256 | |
| ALGO_ID_MAC_HMAC_SHA384 | back to summary |
|---|---|
| public static final String ALGO_ID_MAC_HMAC_SHA384 HMAC - Optional HMAC-SHA284 | |
| ALGO_ID_MAC_HMAC_SHA512 | back to summary |
|---|---|
| public static final String ALGO_ID_MAC_HMAC_SHA512 HMAC - Optional HMAC-SHA512 | |
| ALGO_ID_SIGNATURE_DSA | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_DSA Signature - Required DSAwithSHA1 (DSS) | |
| ALGO_ID_SIGNATURE_DSA_SHA256 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_DSA_SHA256 Signature - Optional DSAwithSHA256 | |
| ALGO_ID_SIGNATURE_ECDSA_RIPEMD160 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_ECDSA_RIPEMD160 Signature - Optional ECDSAwithRIPEMD160 | |
| ALGO_ID_SIGNATURE_ECDSA_SHA1 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_ECDSA_SHA1 Signature - Optional ECDSAwithSHA1 | |
| ALGO_ID_SIGNATURE_ECDSA_SHA224 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_ECDSA_SHA224 Signature - Optional ECDSAwithSHA224 | |
| ALGO_ID_SIGNATURE_ECDSA_SHA256 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_ECDSA_SHA256 Signature - Optional ECDSAwithSHA256 | |
| ALGO_ID_SIGNATURE_ECDSA_SHA384 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_ECDSA_SHA384 Signature - Optional ECDSAwithSHA384 | |
| ALGO_ID_SIGNATURE_ECDSA_SHA3_224 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_ECDSA_SHA3_224 Signature - SHA3-224withECDSA | |
| ALGO_ID_SIGNATURE_ECDSA_SHA3_256 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_ECDSA_SHA3_256 Signature - SHA3-256withECDSA | |
| ALGO_ID_SIGNATURE_ECDSA_SHA3_384 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_ECDSA_SHA3_384 Signature - SHA3-384withECDSA | |
| ALGO_ID_SIGNATURE_ECDSA_SHA3_512 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_ECDSA_SHA3_512 Signature - SHA3-512withECDSA | |
| ALGO_ID_SIGNATURE_ECDSA_SHA512 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_ECDSA_SHA512 Signature - Optional ECDSAwithSHA512 | |
| ALGO_ID_SIGNATURE_EDDSA_ED25519 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_EDDSA_ED25519 Signature - EDDSA ED25519 | |
| ALGO_ID_SIGNATURE_EDDSA_ED448 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_EDDSA_ED448 Signature - EDDSA ED448 | |
| ALGO_ID_SIGNATURE_NOT_RECOMMENDED_RSA_MD5 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_NOT_RECOMMENDED_RSA_MD5 Signature - NOT Recommended RSAwithMD5 | |
| ALGO_ID_SIGNATURE_RSA | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_RSA Signature - Recommended RSAwithSHA1 | |
| ALGO_ID_SIGNATURE_RSA_PSS | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_RSA_PSS Signature - Optional RSASSA-PSS | |
| ALGO_ID_SIGNATURE_RSA_RIPEMD160 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_RSA_RIPEMD160 Signature - Optional RSAwithRIPEMD160 | |
| ALGO_ID_SIGNATURE_RSA_SHA1 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_RSA_SHA1 Signature - Recommended RSAwithSHA1 | |
| ALGO_ID_SIGNATURE_RSA_SHA1_MGF1 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_RSA_SHA1_MGF1 Signature - Optional RSAwithSHA1andMGF1 | |
| ALGO_ID_SIGNATURE_RSA_SHA224 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_RSA_SHA224 Signature - Optional RSAwithSHA224 | |
| ALGO_ID_SIGNATURE_RSA_SHA224_MGF1 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_RSA_SHA224_MGF1 Signature - Optional RSAwithSHA224andMGF1 | |
| ALGO_ID_SIGNATURE_RSA_SHA256 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_RSA_SHA256 Signature - Optional RSAwithSHA256 | |
| ALGO_ID_SIGNATURE_RSA_SHA256_MGF1 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_RSA_SHA256_MGF1 Signature - Optional RSAwithSHA256andMGF1 | |
| ALGO_ID_SIGNATURE_RSA_SHA384 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_RSA_SHA384 Signature - Optional RSAwithSHA384 | |
| ALGO_ID_SIGNATURE_RSA_SHA384_MGF1 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_RSA_SHA384_MGF1 Signature - Optional RSAwithSHA384andMGF1 | |
| ALGO_ID_SIGNATURE_RSA_SHA3_224_MGF1 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_RSA_SHA3_224_MGF1 Signature - Optional RSAwithSHA3_224andMGF1 | |
| ALGO_ID_SIGNATURE_RSA_SHA3_256_MGF1 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_RSA_SHA3_256_MGF1 Signature - Optional RSAwithSHA3_256andMGF1 | |
| ALGO_ID_SIGNATURE_RSA_SHA3_384_MGF1 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_RSA_SHA3_384_MGF1 Signature - Optional RSAwithSHA3_384andMGF1 | |
| ALGO_ID_SIGNATURE_RSA_SHA3_512_MGF1 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_RSA_SHA3_512_MGF1 Signature - Optional RSAwithSHA3_512andMGF1 | |
| ALGO_ID_SIGNATURE_RSA_SHA512 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_RSA_SHA512 Signature - Optional RSAwithSHA512 | |
| ALGO_ID_SIGNATURE_RSA_SHA512_MGF1 | back to summary |
|---|---|
| public static final String ALGO_ID_SIGNATURE_RSA_SHA512_MGF1 Signature - Optional RSAwithSHA512andMGF1 | |
| followManifestsDuringValidation | back to summary |
|---|---|
| private boolean followManifestsDuringValidation Checking the digests in References in a Signature are mandatory, but for References inside a Manifest it is application specific. This boolean is to indicate that the References inside Manifests should be validated. | |
| keyInfo | back to summary |
|---|---|
| private KeyInfo keyInfo ds:Signature.ds:KeyInfo | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG Hides com. | |
| MODE_SIGN | back to summary |
|---|---|
| private static final int MODE_SIGN | |
| MODE_VERIFY | back to summary |
|---|---|
| private static final int MODE_VERIFY | |
| signatureValueElement | back to summary |
|---|---|
| private Element signatureValueElement | |
| signedInfo | back to summary |
|---|---|
| private final SignedInfo signedInfo ds:Signature.ds:SignedInfo element | |
| state | back to summary |
|---|---|
| private int state | |
| XMLSignature | back to summary |
|---|---|
| public XMLSignature(Document doc, String baseURI, String signatureMethodURI) throws XMLSecurityException This creates a new | |
| XMLSignature | back to summary |
|---|---|
| public XMLSignature(Document doc, String baseURI, String signatureMethodURI, Provider provider) throws XMLSecurityException This creates a new | |
| XMLSignature | back to summary |
|---|---|
| public XMLSignature(Document doc, String baseURI, String signatureMethodURI, int hmacOutputLength) throws XMLSecurityException Constructor XMLSignature | |
| XMLSignature | back to summary |
|---|---|
| public XMLSignature(Document doc, String baseURI, String signatureMethodURI, int hmacOutputLength, Provider provider) throws XMLSecurityException Constructor XMLSignature | |
| XMLSignature | back to summary |
|---|---|
| public XMLSignature(Document doc, String baseURI, String signatureMethodURI, String canonicalizationMethodURI) throws XMLSecurityException Constructor XMLSignature
| |
| XMLSignature | back to summary |
|---|---|
| public XMLSignature(Document doc, String baseURI, String signatureMethodURI, String canonicalizationMethodURI, Provider provider) throws XMLSecurityException Constructor XMLSignature
| |
| XMLSignature | back to summary |
|---|---|
| public XMLSignature(Document doc, String baseURI, String signatureMethodURI, int hmacOutputLength, String canonicalizationMethodURI) throws XMLSecurityException Constructor XMLSignature
| |
| XMLSignature | back to summary |
|---|---|
| public XMLSignature(Document doc, String baseURI, String signatureMethodURI, int hmacOutputLength, String canonicalizationMethodURI, Provider provider, AlgorithmParameterSpec spec) throws XMLSecurityException Constructor XMLSignature
| |
| XMLSignature | back to summary |
|---|---|
| public XMLSignature(Document doc, String baseURI, Element signatureMethodElem, Element canonicalizationMethodElem) throws XMLSecurityException Creates a XMLSignature in a Document | |
| XMLSignature | back to summary |
|---|---|
| public XMLSignature(Document doc, String baseURI, Element signatureMethodElem, Element canonicalizationMethodElem, Provider provider) throws XMLSecurityException | |
| XMLSignature | back to summary |
|---|---|
| public XMLSignature(Element element, String baseURI) throws XMLSignatureException, XMLSecurityException This will parse the element and construct the Java Objects. That will allow a user to validate the signature.
| |
| XMLSignature | back to summary |
|---|---|
| public XMLSignature(Element element, String baseURI, Provider provider) throws XMLSignatureException, XMLSecurityException This will parse the element and construct the Java Objects. That will allow a user to validate the signature.
| |
| XMLSignature | back to summary |
|---|---|
| public XMLSignature(Element element, String baseURI, boolean secureValidation) throws XMLSignatureException, XMLSecurityException This will parse the element and construct the Java Objects. That will allow a user to validate the signature.
| |
| XMLSignature | back to summary |
|---|---|
| public XMLSignature(Element element, String baseURI, boolean secureValidation, Provider provider) throws XMLSignatureException, XMLSecurityException This will parse the element and construct the Java Objects. That will allow a user to validate the signature.
| |
| addDocument | back to summary |
|---|---|
| public void addDocument(String referenceURI, Transforms trans, String digestURI, String referenceId, String referenceType) throws XMLSignatureException Add a Reference with full parameters to this Signature
| |
| addDocument | back to summary |
|---|---|
| public void addDocument(String referenceURI, Transforms trans, String digestURI) throws XMLSignatureException This method is a proxy method for the
| |
| addDocument | back to summary |
|---|---|
| public void addDocument(String referenceURI, Transforms trans) throws XMLSignatureException Adds a Reference with just the URI and the transforms. This used the SHA1 algorithm as a default digest algorithm.
| |
| addDocument | back to summary |
|---|---|
| public void addDocument(String referenceURI) throws XMLSignatureException Add a Reference with just this URI. It uses SHA1 by default as the digest algorithm
| |
| addKeyInfo | back to summary |
|---|---|
| public void addKeyInfo(X509Certificate cert) throws XMLSecurityException Add an X509 Certificate to the KeyInfo. This will include the whole cert inside X509Data/X509Certificate tags.
| |
| addKeyInfo | back to summary |
|---|---|
| public void addKeyInfo(PublicKey pk) Add this public key to the KeyInfo. This will include the complete key in the KeyInfo structure. | |
| addResourceResolver | back to summary |
|---|---|
| public void addResourceResolver(ResourceResolverSpi resolver) Adds a | |
| appendObject | back to summary |
|---|---|
| public void appendObject(ObjectContainer object) throws XMLSignatureException Appends an Object (not a
| |
| checkSignatureValue | back to summary |
|---|---|
| public boolean checkSignatureValue(X509Certificate cert) throws XMLSignatureException Extracts the public key from the certificate and verifies if the signature is valid by re-digesting all References, comparing those against the stored DigestValues and then checking to see if the Signatures match on the SignedInfo.
| |
| checkSignatureValue | back to summary |
|---|---|
| public boolean checkSignatureValue(Key pk) throws XMLSignatureException Verifies if the signature is valid by redigesting all References, comparing those against the stored DigestValues and then checking to see if the Signatures match on the SignedInfo.
| |
| createSecretKey | back to summary |
|---|---|
| public SecretKey createSecretKey(byte[] secretKeyBytes) Proxy method for
| |
| getBaseLocalName | back to summary |
|---|---|
| public String getBaseLocalName() Implements abstract com. Get the local name of this element | |
| getId | back to summary |
|---|---|
| public String getId() Returns the
| |
| getKeyInfo | back to summary |
|---|---|
| public KeyInfo getKeyInfo() Returns the KeyInfo child. If we are in signing mode and the KeyInfo
does not exist yet, it is created on demand and added to the Signature.
| |
| getObjectItem | back to summary |
|---|---|
| public ObjectContainer getObjectItem(int i) Returns the
| |
| getObjectLength | back to summary |
|---|---|
| public int getObjectLength() Returns the number of all
| |
| getSignatureValue | back to summary |
|---|---|
| public byte[] getSignatureValue() throws XMLSignatureException Returns the octet value of the SignatureValue element. Throws an XMLSignatureException if it has no or wrong content.
| |
| getSignedInfo | back to summary |
|---|---|
| public SignedInfo getSignedInfo() Returns the completely parsed
| |
| setFollowNestedManifests | back to summary |
|---|---|
| public void setFollowNestedManifests(boolean followManifests) Signal whether Manifest should be automatically validated. Checking the digests in References in a Signature are mandatory, but for References inside a Manifest it is application specific. This boolean is to indicate that the References inside Manifests should be validated. | |
| setId | back to summary |
|---|---|
| public void setId(String id) Sets the
| |
| setSignatureValueElement | back to summary |
|---|---|
| private void setSignatureValueElement(byte[] bytes) Base64 encodes and sets the bytes as the content of the SignatureValue Node.
| |
| sign | back to summary |
|---|---|
| public void sign(Key signingKey) throws XMLSignatureException Digests all References in the SignedInfo, calculates the signature value and sets it in the SignatureValue Element.
| |