Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.xml.security.signature
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

    public class Manifest

extends SignatureElementProxy

Handles `<ds:Manifest>` elements.

This element holds the `Reference` elements

Field Summary
`static int` | `MAXIMUM_REFERENCE_COUNT` The maximum number of references per Manifest, if secure validation is enabled.

Fields inherited from class org.apache.xml.security.utils.ElementProxy
`baseURI, constructionElement, doc`

Constructor Summary
`Manifest(org.w3c.dom.Document doc)` Constructs `Manifest`
`Manifest(org.w3c.dom.Element element, java.lang.String baseURI)` Constructor Manifest
`Manifest(org.w3c.dom.Element element, java.lang.String baseURI, boolean secureValidation)` Constructor Manifest

Method Summary
`void` | `addDocument(java.lang.String baseURI, java.lang.String referenceURI, Transforms transforms, java.lang.String digestURI, java.lang.String referenceId, java.lang.String referenceType)` This `addDocument` method is used to add a new resource to the signed info.
`void` | `addResourceResolver(ResourceResolver resolver)` Adds Resource Resolver for retrieving resources at specified `URI` attribute in `reference` element
`void` | `addResourceResolver(ResourceResolverSpi resolverSpi)` Adds Resource Resolver for retrieving resources at specified `URI` attribute in `reference` element
`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.
`java.lang.String` | `getBaseLocalName()` Method getBaseLocalName
`java.lang.String` | `getId()` Returns the `Id` attribute
`int` | `getLength()` Return the nonnegative number of added references.
`java.util.List<ResourceResolver>` | `getPerManifestResolvers()` Get the Per-Manifest Resolver List
`XMLSignatureInput` | `getReferencedContentAfterTransformsItem(int i)` Method getReferencedContentAfterTransformsItem
`XMLSignatureInput` | `getReferencedContentBeforeTransformsItem(int i)` Method getReferencedContentPriorTransformsItem
`java.util.Map<java.lang.String,java.lang.String>` | `getResolverProperties()` Get the resolver property map
`java.lang.String` | `getResolverProperty(java.lang.String key)` Returns the value at specified key
`byte[]` | `getSignedContentItem(int i)` Method getSignedContentItem
`int` | `getSignedContentLength()` Method getSignedContentLength
`boolean` | `getVerificationResult(int index)` After verifying a `Manifest` or a `SignedInfo` using the `verifyReferences()` or `SignedInfo.verify()` methods, the individual results can be retrieved with this method.
`boolean` | `isSecureValidation()`
`Reference` | `item(int i)` Return the ith reference.
`void` | `setId(java.lang.String Id)` Sets the `Id` attribute
`void` | `setResolverProperty(java.lang.String key, java.lang.String value)` Used to pass parameters like proxy servers etc to the ResourceResolver implementation.
`boolean` | `verifyReferences()` Used to do a reference validation of all enclosed references using the `Reference.verify()` method.
`boolean` | `verifyReferences(boolean followManifests)` Used to do a reference validation of all enclosed references using the `Reference.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, createElementForFamilyLocal, getBaseURI, getBigIntegerFromChildElement, getBytesFromChildElement, getBytesFromTextChild, getDefaultPrefix, getDocument, getElement, getElementPlusReturns, getTextFromChildElement, getTextFromTextChild, length, registerDefaultPrefixes, setDefaultPrefix, setElement, setXPathNamespaceContext`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### MAXIMUM_REFERENCE_COUNT

    public static final int MAXIMUM_REFERENCE_COUNT

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

  See Also:
    Constant Field Values

Constructor Detail

### Manifest

    public Manifest(org.w3c.dom.Document doc)

  Constructs `Manifest`

  Parameters:
    `doc` - the `Document` in which `XMLsignature` is placed

### Manifest

    public Manifest(org.w3c.dom.Element element,
                    java.lang.String baseURI)
             throws XMLSecurityException

  Constructor Manifest

  Parameters:
    `element` -
    `baseURI` -
  Throws:
    `XMLSecurityException`

### Manifest

    public Manifest(org.w3c.dom.Element element,
                    java.lang.String baseURI,
                    boolean secureValidation)
             throws XMLSecurityException

  Constructor Manifest

  Parameters:
    `element` -
    `baseURI` -
    `secureValidation` -
  Throws:
    `XMLSecurityException`

Method Detail

### addDocument

    public void addDocument(java.lang.String baseURI,
                            java.lang.String referenceURI,
                            Transforms transforms,
                            java.lang.String digestURI,
                            java.lang.String referenceId,
                            java.lang.String referenceType)
                     throws XMLSignatureException

  This `addDocument` method is used to add a new resource to the signed info. A `Reference` is built from the supplied values.

  Parameters:
    `baseURI` - the URI of the resource where the XML instance was stored
    `referenceURI` - `URI` attribute in `Reference` for specifying where data is
    `transforms` - org.apache.xml.security.signature.Transforms object with an ordered list of transformations to be performed.
    `digestURI` - The digest algorithm URI to be used.
    `referenceId` -
    `referenceType` -
  Throws:
    `XMLSignatureException`

### generateDigestValues

    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.

  Throws:
    `ReferenceNotInitializedException`
    `XMLSignatureException`

### getLength

    public int getLength()

  Return the nonnegative number of added references.

  Returns:
    the number of references

### item

    public Reference item(int i)
                   throws XMLSecurityException

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

  Parameters:
    `i` - Index of the requested `Reference`
  Returns:
    the ith reference
  Throws:
    `XMLSecurityException`

### setId

    public void setId(java.lang.String Id)

  Sets the `Id` attribute

  Parameters:
    `Id` - the `Id` attribute in `ds:Manifest`

### getId

    public java.lang.String getId()

  Returns the `Id` attribute

  Returns:
    the `Id` attribute in `ds:Manifest`

### verifyReferences

    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 `Reference`s 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:
    true if all References verify, false if one or more do not verify.
  Throws:
    `MissingResourceFailureException` - if a `Reference` does not verify (throws a `ReferenceNotInitializedException` because of an uninitialized `XMLSignatureInput`
    `XMLSecurityException`
  See Also:
    `Reference.verify()`, `SignedInfo.verify()`, `MissingResourceFailureException`

### verifyReferences

    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 `Reference`s 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

  Parameters:
    `followManifests` -
  Returns:
    true if all References verify, false if one or more do not verify.
  Throws:
    `MissingResourceFailureException` - if a `Reference` does not verify (throws a `ReferenceNotInitializedException` because of an uninitialized `XMLSignatureInput`
    `XMLSecurityException`
  See Also:
    `Reference.verify()`, `SignedInfo.verify(boolean)`, `MissingResourceFailureException`

### getVerificationResult

    public boolean getVerificationResult(int index)
                                  throws XMLSecurityException

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

  Parameters:
    `index` - an index of into a `Manifest` or a `SignedInfo`
  Returns:
    the results of reference validation at the specified index
  Throws:
    `XMLSecurityException`

### addResourceResolver

    public void addResourceResolver(ResourceResolver resolver)

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

  Parameters:
    `resolver` - `ResourceResolver` can provide the implemenatin subclass of `ResourceResolverSpi` for retrieving resource.

### addResourceResolver

    public void addResourceResolver(ResourceResolverSpi resolverSpi)

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

  Parameters:
    `resolverSpi` - the implementation subclass of `ResourceResolverSpi` for retrieving the resource.

### getPerManifestResolvers

    public java.util.List<ResourceResolver> getPerManifestResolvers()

  Get the Per-Manifest Resolver List

  Returns:
    the per-manifest Resolver List

### getResolverProperties

    public java.util.Map<java.lang.String,java.lang.String> getResolverProperties()

  Get the resolver property map

  Returns:
    the resolver property map

### setResolverProperty

    public void setResolverProperty(java.lang.String key,
                                    java.lang.String value)

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

  Parameters:
    `key` - the key
    `value` - the value

### getResolverProperty

    public java.lang.String getResolverProperty(java.lang.String key)

  Returns the value at specified key

  Parameters:
    `key` - the key
  Returns:
    the value

### getSignedContentItem

    public byte[] getSignedContentItem(int i)
                                throws XMLSignatureException

  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

    public XMLSignatureInput getReferencedContentAfterTransformsItem(int i)
                                                              throws XMLSecurityException

  Method getReferencedContentAfterTransformsItem

  Parameters:
    `i` -
  Returns:
    The contents after transformation of the reference i.
  Throws:
    `XMLSecurityException`

### getSignedContentLength

    public int getSignedContentLength()

  Method getSignedContentLength

  Returns:
    The number of references contained in this reference.

### getBaseLocalName

    public java.lang.String getBaseLocalName()

  Method getBaseLocalName

  Specified by:
    `getBaseLocalName` in class `ElementProxy`
  Returns:
    the localname of the Elements of the sub-class.

### isSecureValidation

    public boolean isSecureValidation()

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD