Package org.opensaml.xmlsec.signature.support

# Class URIContentReference

java.lang.Object
org.opensaml.xmlsec.signature.support.URIContentReference

All Implemented Interfaces:
  `ConfigurableContentReference`, `ContentReference`, `TransformsConfigurableContentReference`

Direct Known Subclasses:
  `DocumentInternalIDContentReference`

public class URIContentReference extends Object implements ConfigurableContentReference, TransformsConfigurableContentReference
A generic content reference that uses a URI to reference the content to be signed.

The default digest algorithm used is `SignatureConstants.ALGO_ID_DIGEST_SHA256`.

## Field Summary

Fields
Modifier and Type
Field
Description
`private String`
`digestAlgorithm`
Algorithm used to digest the content .
`private final org.slf4j.Logger`
`log`
Logger.
`private final String`
`referenceID`
Element reference ID.
`private final List<String>`
`transforms`
Transforms applied to the content.

## Constructor Summary

Constructors
Constructor
Description
`URIContentReference(String refID)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`createReference(org.apache.xml.security.signature.XMLSignature signature)`
Called by the signature marshaller to allow references to be added to the signature.
`String`
`getDigestAlgorithm()`
Gets the algorithm used to digest the content.
`List<String>`
`getTransforms()`
Gets the transforms applied to the content prior to digest generation.
`void`
`setDigestAlgorithm(String newAlgorithm)`
Sets the algorithm used to digest the content.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Logger.

### referenceID

@Nullable private final String referenceID
Element reference ID.

### digestAlgorithm

@Nullable private String digestAlgorithm
Algorithm used to digest the content .

### transforms

@Nonnull private final List<String> transforms
Transforms applied to the content.

## Constructor Details

### URIContentReference

public URIContentReference(@Nullable String refID)
Constructor. The anchor designator (#) must not be included in the ID.

Parameters:
  `refID` - the reference ID of the element to be signed

## Method Details

### getTransforms

@Nonnull @Live public List<String> getTransforms()
Gets the transforms applied to the content prior to digest generation.

Specified by:
  `getTransforms` in interface `TransformsConfigurableContentReference`
Returns:
  the transforms applied to the content prior to digest generation

### getDigestAlgorithm

@Nullable public String getDigestAlgorithm()
Gets the algorithm used to digest the content..

Specified by:
  `getDigestAlgorithm` in interface `ConfigurableContentReference`
Returns:
  the algorithm used to digest the content

### setDigestAlgorithm

public void setDigestAlgorithm(@Nullable String newAlgorithm)
Sets the algorithm used to digest the content..

Specified by:
  `setDigestAlgorithm` in interface `ConfigurableContentReference`
Parameters:
  `newAlgorithm` - the algorithm used to digest the content

### createReference

public void createReference(@Nonnull org.apache.xml.security.signature.XMLSignature signature)
Called by the signature marshaller to allow references to be added to the signature.

Specified by:
  `createReference` in interface `ContentReference`
Parameters:
  `signature` - the signature object