APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xml.internal.security.signature

public Class Manifest

extends SignatureElementProxy
Class Inheritance
Known Direct Subclasses
com.sun.org.apache.xml.internal.security.signature.SignedInfo
Imports
java.io.IOException, java.security.AccessController, .PrivilegedAction, java.util.ArrayList, .Collections, .HashMap, .List, .Map, .Set, com.sun.org.apache.xml.internal.security.c14n.CanonicalizationException, .InvalidCanonicalizerException, com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException, com.sun.org.apache.xml.internal.security.parser.XMLParserException, com.sun.org.apache.xml.internal.security.transforms.Transforms, com.sun.org.apache.xml.internal.security.utils.Constants, .I18n, .SignatureElementProxy, .XMLUtils, com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverSpi, org.w3c.dom.Attr, .DOMException, .Document, .Element, .Node

Handles <ds:Manifest> elements.

This element holds the Reference elements

Field Summary

Modifier and TypeField and Description
private static final Logger
public static final int
MAXIMUM_REFERENCE_COUNT

The default maximum number of references per Manifest, if secure validation is enabled.

private List<ResourceResolverSpi>
perManifestResolvers

Field perManifestResolvers

private static Integer
private List<Reference>
references

Field references

private Element[]
private Map<String, String>
resolverProperties

Field resolverProperties

private boolean
private List<VerifiedReference>
verificationResults

Field verificationResults[]

Constructor Summary

AccessConstructor and Description
public
Manifest(Document
the Document in which XMLsignature is placed
doc
)

Constructs Manifest

public
Manifest(Element element, String baseURI)

Constructor Manifest

public
Manifest(Element element, String baseURI, boolean secureValidation)

Constructor Manifest

Method Summary

Modifier and TypeMethod and Description
public void
addDocument(String
the URI of the resource where the XML instance was stored
baseURI
,
String
URI attribute in Reference for specifying where data is
referenceURI
,
Transforms
com.sun.org.apache.xml.internal.security.signature.Transforms object with an ordered list of transformations to be performed.
transforms
,
String
The digest algorithm URI to be used.
digestURI
,
String referenceId, String referenceType)

This addDocument method is used to add a new resource to the signed info.

public void
addResourceResolver(ResourceResolverSpi
ResourceResolverSpi can provide the implementation subclass of ResourceResolverSpi for retrieving resource.
resolver
)

Adds Resource Resolver for retrieving resources at specified URI attribute in reference element

public void
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.

public String
getBaseLocalName()

Implements abstract com.sun.org.apache.xml.internal.security.utils.ElementProxy.getBaseLocalName.

Method getBaseLocalName Returns the localname of the Elements of the sub-class.

public String

Returns:

the Id attribute in ds:Manifest
getId
()

Returns the Id attribute

public int

Returns:

the number of references
getLength
()

Return the nonnegative number of added references.

public List<ResourceResolverSpi>

Returns:

the per-manifest Resolver List
getPerManifestResolvers
()

Get the Per-Manifest Resolver List

public XMLSignatureInput

Returns:

The contents after transformation of the reference i.
getReferencedContentAfterTransformsItem
(int i)

Method getReferencedContentAfterTransformsItem

public XMLSignatureInput

Returns:

The contents before transformation of the reference i.
getReferencedContentBeforeTransformsItem
(int i)

Method getReferencedContentPriorTransformsItem

public Map<String, String>

Returns:

the resolver property map
getResolverProperties
()

Get the resolver property map

public String

Returns:

the value
getResolverProperty
(String
the key
key
)

Returns the value at specified key

public byte[]

Returns:

The signed content of the i reference.
getSignedContentItem
(int i)

Method getSignedContentItem

public int

Returns:

The number of references contained in this reference.
getSignedContentLength
()

Method getSignedContentLength

public boolean

Returns:

the results of reference validation at the specified index
getVerificationResult
(int
an index of into a Manifest or a SignedInfo
index
)

After verifying a Manifest or a SignedInfo using the Manifest#verifyReferences() or SignedInfo#verify() methods, the individual results can be retrieved with this method.

public List<VerifiedReference>
getVerificationResults()

Get the list of verification result objects

public boolean
public Reference

Returns:

the ith reference
item
(int
Index of the requested Reference
i
)

Return the ith reference.

public void
setId(String
the Id attribute in ds:Manifest
Id
)

Sets the Id attribute

public void
setResolverProperty(String
the key
key
,
String
the value
value
)

Used to pass parameters like proxy servers etc to the ResourceResolver implementation.

public boolean

Returns:

true if all References verify, false if one or more do not verify.
verifyReferences
()

Used to do a reference validation of all enclosed references using the Reference#verify method.

public boolean

Returns:

true if all References verify, false if one or more do not verify.
verifyReferences
(boolean followManifests)

Used to do a reference validation of all enclosed references using the Reference#verify method.

Inherited from com.sun.org.apache.xml.internal.security.utils.SignatureElementProxy:
getBaseNamespace

Field Detail

LOGback to summary
private static final Logger LOG

Hides com.sun.org.apache.xml.internal.security.utils.ElementProxy.LOG.

MAXIMUM_REFERENCE_COUNTback to summary
public static final int MAXIMUM_REFERENCE_COUNT

The default maximum number of references per Manifest, if secure validation is enabled.

perManifestResolversback to summary
private List<ResourceResolverSpi> perManifestResolvers

Field perManifestResolvers

referenceCountback to summary
private static Integer referenceCount
Annotations
@SuppressWarnings:removal
referencesback to summary
private List<Reference> references

Field references

referencesElback to summary
private Element[] referencesEl
resolverPropertiesback to summary
private Map<String, String> resolverProperties

Field resolverProperties

secureValidationback to summary
private boolean secureValidation
verificationResultsback to summary
private List<VerifiedReference> verificationResults

Field verificationResults[]

Constructor Detail

Manifestback to summary
public Manifest(Document doc)

Constructs Manifest

Parameters
doc:Document

the Document in which XMLsignature is placed

Manifestback to summary
public Manifest(Element element, String baseURI) throws XMLSecurityException

Constructor Manifest

Manifestback to summary
public Manifest(Element element, String baseURI, boolean secureValidation) throws XMLSecurityException

Constructor Manifest

Method Detail

addDocumentback to summary
public void addDocument(String baseURI, String referenceURI, Transforms transforms, String digestURI, String referenceId, String referenceType) throws XMLSignatureException

This addDocument method is used to add a new resource to the signed info. A com.sun.org.apache.xml.internal.security.signature.Reference is built from the supplied values.

Parameters
baseURI:String

the URI of the resource where the XML instance was stored

referenceURI:String

URI attribute in Reference for specifying where data is

transforms:Transforms

com.sun.org.apache.xml.internal.security.signature.Transforms object with an ordered list of transformations to be performed.

digestURI:String

The digest algorithm URI to be used.

addResourceResolverback to summary
public void addResourceResolver(ResourceResolverSpi resolver)

Adds Resource Resolver for retrieving resources at specified URI attribute in reference element

Parameters
resolver:ResourceResolverSpi

ResourceResolverSpi can provide the implementation subclass of ResourceResolverSpi for retrieving resource.

generateDigestValuesback to summary
public void generateDigestValues() throws XMLSignatureException, ReferenceNotInitializedException

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 necessary data is in place.

getBaseLocalNameback to summary
public String getBaseLocalName()

Implements abstract com.sun.org.apache.xml.internal.security.utils.ElementProxy.getBaseLocalName.

Doc from com.sun.org.apache.xml.internal.security.utils.ElementProxy.getBaseLocalName.

Method getBaseLocalName Returns the localname of the Elements of the sub-class.

Annotations
@Override
getIdback to summary
public String getId()

Returns the Id attribute

Returns:String

the Id attribute in ds:Manifest

getLengthback to summary
public int getLength()

Return the nonnegative number of added references.

Returns:int

the number of references

getPerManifestResolversback to summary
public List<ResourceResolverSpi> getPerManifestResolvers()

Get the Per-Manifest Resolver List

Returns:List<ResourceResolverSpi>

the per-manifest Resolver List

getReferencedContentAfterTransformsItemback to summary
public XMLSignatureInput getReferencedContentAfterTransformsItem(int i) throws XMLSecurityException

Method getReferencedContentAfterTransformsItem

Returns:XMLSignatureInput

The contents after transformation of the reference i.

getReferencedContentBeforeTransformsItemback to summary
public XMLSignatureInput getReferencedContentBeforeTransformsItem(int i) throws XMLSecurityException

Method getReferencedContentPriorTransformsItem

Returns:XMLSignatureInput

The contents before transformation of the reference i.

getResolverPropertiesback to summary
public Map<String, String> getResolverProperties()

Get the resolver property map

Returns:Map<String, String>

the resolver property map

getResolverPropertyback to summary
public String getResolverProperty(String key)

Returns the value at specified key

Parameters
key:String

the key

Returns:String

the value

getSignedContentItemback to summary
public byte[] getSignedContentItem(int i) throws XMLSignatureException

Method getSignedContentItem

Returns:byte[]

The signed content of the i reference.

getSignedContentLengthback to summary
public int getSignedContentLength()

Method getSignedContentLength

Returns:int

The number of references contained in this reference.

getVerificationResultback to summary
public boolean getVerificationResult(int index) throws XMLSecurityException

After verifying a Manifest or a SignedInfo using the Manifest#verifyReferences() or SignedInfo#verify() methods, the individual results can be retrieved with this method.

Parameters
index:int

an index of into a Manifest or a SignedInfo

Returns:boolean

the results of reference validation at the specified index

getVerificationResultsback to summary
public List<VerifiedReference> getVerificationResults()

Get the list of verification result objects

isSecureValidationback to summary
public boolean isSecureValidation()
itemback to summary
public Reference item(int i) throws XMLSecurityException

Return the ith reference. Valid i values are 0 to {link@ getSize}-1.

Parameters
i:int

Index of the requested Reference

Returns:Reference

the ith reference

setIdback to summary
public void setId(String Id)

Sets the Id attribute

Parameters
Id:String

the Id attribute in ds:Manifest

setResolverPropertyback to summary
public void setResolverProperty(String key, String value)

Used to pass parameters like proxy servers etc to the ResourceResolver implementation.

Parameters
key:String

the key

value:String

the value

verifyReferencesback to summary
public boolean verifyReferences() throws MissingResourceFailureException, XMLSecurityException

Used to do a reference validation of all enclosed references using the Reference#verify method.

This step loops through all References and does verify the hash values. If one or more verifications fail, the method returns false. If all verifications are successful, it returns true. The results of the individual reference validations are available by using the getVerificationResult(int) method

Returns:boolean

true if all References verify, false if one or more do not verify.

Exceptions
MissingResourceFailureException:
if a Reference does not verify (throws a com.sun.org.apache.xml.internal.security.signature.ReferenceNotInitializedException because of an uninitialized XMLSignatureInput
See Also
com.sun.org.apache.xml.internal.security.signature.Reference#verify, com.sun.org.apache.xml.internal.security.signature.SignedInfo#verify(), com.sun.org.apache.xml.internal.security.signature.MissingResourceFailureException
verifyReferencesback to summary
public boolean verifyReferences(boolean followManifests) throws MissingResourceFailureException, XMLSecurityException

Used to do a reference validation of all enclosed references using the Reference#verify method.

This step loops through all References and does verify the hash values. If one or more verifications fail, the method returns false. If all verifications are successful, it returns true. The results of the individual reference validations are available by using the getVerificationResult(int) method

Returns:boolean

true if all References verify, false if one or more do not verify.

Exceptions
MissingResourceFailureException:
if a Reference does not verify (throws a com.sun.org.apache.xml.internal.security.signature.ReferenceNotInitializedException because of an uninitialized XMLSignatureInput
See Also
com.sun.org.apache.xml.internal.security.signature.Reference#verify, com.sun.org.apache.xml.internal.security.signature.SignedInfo#verify(boolean), com.sun.org.apache.xml.internal.security.signature.MissingResourceFailureException