Class CMSTimeStampedDataGenerator
java.lang.Object
org.bouncycastle.tsp.cms.CMSTimeStampedGenerator
org.bouncycastle.tsp.cms.CMSTimeStampedDataGenerator
Builder for an RFC 5544 TimeStampedData object. Given the initial RFC 3161 time
stamp token (computed over the message imprint of the document, and the MetaData
when it is hash-protected) plus the optional content set via the inherited
CMSTimeStampedGenerator.setDataUri(URI)/CMSTimeStampedGenerator.setMetaData(boolean, String, String) methods, it produces a
CMSTimeStampedData whose evidence chain holds that one token.-
Field Summary
Fields inherited from class CMSTimeStampedGenerator
dataUri, metaData -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerate(TimeStampToken timeStamp) Generate a TimeStampedData with no encapsulated content (e.g.generate(TimeStampToken timeStamp, byte[] content) Generate a TimeStampedData encapsulating the passed in content.generate(TimeStampToken timeStamp, InputStream content) Generate a TimeStampedData encapsulating the content drained from the passed in stream.Methods inherited from class CMSTimeStampedGenerator
initialiseMessageImprintDigestCalculator, setDataUri, setMetaData, setMetaData
-
Constructor Details
-
CMSTimeStampedDataGenerator
public CMSTimeStampedDataGenerator()
-
-
Method Details
-
generate
Generate a TimeStampedData with no encapsulated content (e.g. when the document is referenced via a dataUri).- Parameters:
timeStamp- the initial time stamp token.- Returns:
- the generated CMSTimeStampedData.
- Throws:
CMSException- if the structure cannot be built.
-
generate
Generate a TimeStampedData encapsulating the passed in content.- Parameters:
timeStamp- the initial time stamp token.content- the document content to encapsulate.- Returns:
- the generated CMSTimeStampedData.
- Throws:
CMSException- if the structure cannot be built.
-
generate
public CMSTimeStampedData generate(TimeStampToken timeStamp, InputStream content) throws CMSException Generate a TimeStampedData encapsulating the content drained from the passed in stream.- Parameters:
timeStamp- the initial time stamp token.content- a stream over the document content to encapsulate, or null for none.- Returns:
- the generated CMSTimeStampedData.
- Throws:
CMSException- if the content cannot be read or the structure cannot be built.
-