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 inherited CMSTimeStampedGenerator.setDataUri(URI)/CMSTimeStampedGenerator.setMetaData(boolean, String, String) methods, it produces a CMSTimeStampedData whose evidence chain holds that one token.
  • Constructor Details

    • CMSTimeStampedDataGenerator

      public CMSTimeStampedDataGenerator()
  • Method Details

    • 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, 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.