Package org.bouncycastle.tsp.cms
Class CMSTimeStampedDataGenerator
- java.lang.Object
-
- org.bouncycastle.tsp.cms.CMSTimeStampedGenerator
-
- org.bouncycastle.tsp.cms.CMSTimeStampedDataGenerator
-
public class CMSTimeStampedDataGenerator extends CMSTimeStampedGenerator
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 inheritedCMSTimeStampedGenerator.setDataUri(java.net.URI)/CMSTimeStampedGenerator.setMetaData(boolean, java.lang.String, java.lang.String)methods, it produces aCMSTimeStampedDatawhose evidence chain holds that one token.
-
-
Field Summary
-
Fields inherited from class org.bouncycastle.tsp.cms.CMSTimeStampedGenerator
dataUri, metaData
-
-
Constructor Summary
Constructors Constructor Description CMSTimeStampedDataGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CMSTimeStampedDatagenerate(TimeStampToken timeStamp)Generate a TimeStampedData with no encapsulated content (e.g. when the document is referenced via a dataUri).CMSTimeStampedDatagenerate(TimeStampToken timeStamp, byte[] content)Generate a TimeStampedData encapsulating the passed in content.CMSTimeStampedDatagenerate(TimeStampToken timeStamp, java.io.InputStream content)Generate a TimeStampedData encapsulating the content drained from the passed in stream.-
Methods inherited from class org.bouncycastle.tsp.cms.CMSTimeStampedGenerator
initialiseMessageImprintDigestCalculator, setDataUri, setMetaData, setMetaData
-
-
-
-
Method Detail
-
generate
public CMSTimeStampedData generate(TimeStampToken timeStamp) throws CMSException
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
public CMSTimeStampedData generate(TimeStampToken timeStamp, byte[] content) throws CMSException
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, java.io.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.
-
-