Class Manifest
java.lang.Object
org.apache.xml.security.utils.ElementProxy
org.apache.xml.security.utils.SignatureElementProxy
org.apache.xml.security.signature.Manifest
- Direct Known Subclasses:
SignedInfo
Handles
<ds:Manifest>
elements.
This element holds the Reference
elements
- Author:
- $author: $
-
Field Summary
Fields inherited from class org.apache.xml.security.utils.ElementProxy
_baseURI, _constructionElement, _doc, _state, MODE_CREATE, MODE_DECRYPT, MODE_ENCRYPT, MODE_PROCESS, MODE_SIGN, MODE_UNKNOWN, MODE_VERIFY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDocument
(String BaseURI, String referenceURI, Transforms transforms, String digestURI, String ReferenceId, String ReferenceType) ThisaddDocument
method is used to add a new resource to the signed info.void
addResourceResolver
(ResourceResolver resolver) Adds Resource Resolver for retrieving resources at specifiedURI
attribute inreference
elementvoid
addResourceResolver
(ResourceResolverSpi resolverSpi) Adds Resource Resolver for retrieving resources at specifiedURI
attribute inreference
elementvoid
The calculation of the DigestValues in the References must be after the References are already added to the document and during the signing process.Method getBaseLocalNamegetId()
Returns theId
attributeint
Return the nonnegative number of added references.Method getReferencedContentAfterTransformsItemMethod getReferencedContentPriorTransformsItemReturns the value at specified keybyte[]
getSignedContentItem
(int i) Method getSignedContentItemint
Method getSignedContentLengthboolean
getVerificationResult
(int index) After verifying aManifest
or aSignedInfo
using theverifyReferences()
orSignedInfo.verify()
methods, the individual results can be retrieved with this method.item
(int i) Return thei th reference.void
Sets theId
attributevoid
setResolverProperty
(String key, String value) Used to pass parameters like proxy servers etc to the ResourceResolver implementation.boolean
Used to do a reference validation of all enclosed references using theReference.verify()
method.boolean
verifyReferences
(boolean followManifests) Used to do a reference validation of all enclosed references using theReference.verify()
method.Methods inherited from class org.apache.xml.security.utils.SignatureElementProxy
getBaseNamespace
Methods inherited from class org.apache.xml.security.utils.ElementProxy
addBase64Element, addBase64Text, addBigIntegerElement, addText, addTextElement, createElementForFamily, getBaseURI, getBigIntegerFromChildElement, getBytesFromChildElement, getBytesFromTextChild, getDefaultPrefix, getDocument, getElement, getElementPlusReturns, getTextFromChildElement, getTextFromTextChild, guaranteeThatElementInCorrectSpace, length, setDefaultPrefix, setElement, setXPathNamespaceContext
-
Constructor Details
-
Manifest
ConsturtsManifest
- Parameters:
doc
- theDocument
in whichXMLsignature
is placed
-
Manifest
Constructor Manifest- Parameters:
element
-BaseURI
-- Throws:
XMLSecurityException
-
-
Method Details
-
addDocument
public void addDocument(String BaseURI, String referenceURI, Transforms transforms, String digestURI, String ReferenceId, String ReferenceType) throws XMLSignatureException ThisaddDocument
method is used to add a new resource to the signed info. AReference
is built from the supplied values.- Parameters:
BaseURI
- the URI of the resource where the XML instance was storedreferenceURI
-URI
attribute inReference
for specifing where data istransforms
- org.apache.xml.security.signature.Transforms object with an ordered list of transformations to be performed.digestURI
- The digest algorthim URI to be used.ReferenceId
-ReferenceType
-- Throws:
XMLSignatureException
-
generateDigestValues
The calculation of the DigestValues in the References must be after the References are already added to the document and during the signing process. This ensures that all neccesary data is in place. -
getLength
public int getLength()Return the nonnegative number of added references.- Returns:
- the number of references
-
item
Return thei th reference. Validi
values are 0 to{link@ getSize}-1
.- Parameters:
i
- Index of the requestedReference
- Returns:
- the
i th reference - Throws:
XMLSecurityException
-
setId
Sets theId
attribute- Parameters:
Id
- theId
attribute inds:Manifest
-
getId
Returns theId
attribute- Returns:
- the
Id
attribute inds:Manifest
-
verifyReferences
Used to do a reference validation of all enclosed references using theReference.verify()
method.This step loops through all
Reference
s and does verify the hash values. If one or more verifications fail, the method returnsfalse
. If all verifications are successful, it returnstrue
. The results of the individual reference validations are available by using thegetVerificationResult(int)
method- Returns:
- true if all References verify, false if one or more do not verify.
- Throws:
MissingResourceFailureException
- if aReference
does not verify (throws aReferenceNotInitializedException
because of an uninitializedXMLSignatureInput
XMLSecurityException
- See Also:
-
verifyReferences
public boolean verifyReferences(boolean followManifests) throws MissingResourceFailureException, XMLSecurityException Used to do a reference validation of all enclosed references using theReference.verify()
method.This step loops through all
Reference
s and does verify the hash values. If one or more verifications fail, the method returnsfalse
. If all verifications are successful, it returnstrue
. The results of the individual reference validations are available by using thegetVerificationResult(int)
method- Parameters:
followManifests
-- Returns:
- true if all References verify, false if one or more do not verify.
- Throws:
MissingResourceFailureException
- if aReference
does not verify (throws aReferenceNotInitializedException
because of an uninitializedXMLSignatureInput
XMLSecurityException
- See Also:
-
getVerificationResult
After verifying aManifest
or aSignedInfo
using theverifyReferences()
orSignedInfo.verify()
methods, the individual results can be retrieved with this method.- Parameters:
index
- an index of into aManifest
or aSignedInfo
- Returns:
- the results of reference validation at the specified index
- Throws:
XMLSecurityException
-
addResourceResolver
Adds Resource Resolver for retrieving resources at specifiedURI
attribute inreference
element- Parameters:
resolver
-ResourceResolver
can provide the implemenatin subclass ofResourceResolverSpi
for retrieving resource.
-
addResourceResolver
Adds Resource Resolver for retrieving resources at specifiedURI
attribute inreference
element- Parameters:
resolverSpi
- the implemenatin subclass ofResourceResolverSpi
for retrieving resource.
-
setResolverProperty
Used to pass parameters like proxy servers etc to the ResourceResolver implementation.- Parameters:
key
- the keyvalue
- the value
-
getResolverProperty
Returns the value at specified key- Parameters:
key
- the key- Returns:
- the value
-
getSignedContentItem
Method getSignedContentItem- Parameters:
i
-- Returns:
- The signed content of the i reference.
- Throws:
XMLSignatureException
-
getReferencedContentBeforeTransformsItem
public XMLSignatureInput getReferencedContentBeforeTransformsItem(int i) throws XMLSecurityException Method getReferencedContentPriorTransformsItem- Parameters:
i
-- Returns:
- The contents before transformation of the reference i.
- Throws:
XMLSecurityException
-
getReferencedContentAfterTransformsItem
Method getReferencedContentAfterTransformsItem- Parameters:
i
-- Returns:
- The contents after transformation of the reference i.
- Throws:
XMLSecurityException
-
getSignedContentLength
public int getSignedContentLength()Method getSignedContentLength- Returns:
- The nu,ber of references contained in this reference.
-
getBaseLocalName
Method getBaseLocalName- Specified by:
getBaseLocalName
in classElementProxy
- Returns:
- the localname of the Elements of the sub-class.
-