org.bouncycastle.asn1.tsp

## Class ArchiveTimeStamp

- java.lang.Object
- - org.bouncycastle.asn1.ASN1Object
  - - org.bouncycastle.asn1.tsp.ArchiveTimeStamp

- All Implemented Interfaces:
    ASN1Encodable, Encodable

      public class ArchiveTimeStamp
      extends ASN1Object

  Implementation of the Archive Timestamp type defined in RFC4998.
  See Also:
    RFC 4998

    ASN.1 Archive Timestamp

    ArchiveTimeStamp ::= SEQUENCE { digestAlgorithm [Ø] AlgorithmIdentifier OPTIONAL, attributes [1] Attributes OPTIONAL, reducedHashtree [2] SEQUENCE OF PartialHashtree OPTIONAL, timeStamp ContentInfo}

    PartialHashtree ::= SEQUENCE OF OCTET STRING

    Attributes ::= SET SIZE (1..MAX) OF Attribute

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ArchiveTimeStamp(AlgorithmIdentifier digestAlgorithm, Attributes attributes, PartialHashtree[] reducedHashTree, ContentInfo timeStamp)`
    `ArchiveTimeStamp(AlgorithmIdentifier digestAlgorithm, PartialHashtree[] reducedHashTree, ContentInfo timeStamp)`
    `ArchiveTimeStamp(ContentInfo timeStamp)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AlgorithmIdentifier` | `getDigestAlgorithm()` Return the contents of the digestAlgorithm field - null if not set.
    `AlgorithmIdentifier` | `getDigestAlgorithmIdentifier()`
    `PartialHashtree` | `getHashTreeLeaf()` Return the first node in the reduced hash tree which contains the leaf node.
    `static ArchiveTimeStamp` | `getInstance(ASN1TaggedObject taggedObject, boolean declaredExplicit)`
    `static ArchiveTimeStamp` | `getInstance(java.lang.Object obj)` Return an ArchiveTimestamp from the given object.
    `PartialHashtree[]` | `getReducedHashTree()`
    `static ArchiveTimeStamp` | `getTagged(ASN1TaggedObject taggedObject, boolean declaredExplicit)`
    `ContentInfo` | `getTimeStamp()`
    `byte[]` | `getTimeStampDigestValue()`
    `ASN1Primitive` | `toASN1Primitive()` Method providing a primitive representation of this object suitable for encoding.

    - ### Methods inherited from class org.bouncycastle.asn1.ASN1Object

      `encodeTo, encodeTo, equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode`

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

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

- - ### Constructor Detail

    - #### ArchiveTimeStamp

          public ArchiveTimeStamp(AlgorithmIdentifier digestAlgorithm,
                                  PartialHashtree[] reducedHashTree,
                                  ContentInfo timeStamp)

    - #### ArchiveTimeStamp

          public ArchiveTimeStamp(ContentInfo timeStamp)

    - #### ArchiveTimeStamp

          public ArchiveTimeStamp(AlgorithmIdentifier digestAlgorithm,
                                  Attributes attributes,
                                  PartialHashtree[] reducedHashTree,
                                  ContentInfo timeStamp)

  - ### Method Detail

    - #### getInstance

          public static ArchiveTimeStamp getInstance(java.lang.Object obj)

      Return an ArchiveTimestamp from the given object.
      Parameters:
        `obj` - the object we want converted.
      Returns:
        an ArchiveTimestamp instance, or null.
      Throws:
        `java.lang.IllegalArgumentException` - if the object cannot be converted.

    - #### getInstance

          public static ArchiveTimeStamp getInstance(ASN1TaggedObject taggedObject,
                                                     boolean declaredExplicit)

    - #### getTagged

          public static ArchiveTimeStamp getTagged(ASN1TaggedObject taggedObject,
                                                   boolean declaredExplicit)

    - #### getDigestAlgorithmIdentifier

          public AlgorithmIdentifier getDigestAlgorithmIdentifier()

    - #### getTimeStampDigestValue

          public byte[] getTimeStampDigestValue()

    - #### getDigestAlgorithm

          public AlgorithmIdentifier getDigestAlgorithm()

      Return the contents of the digestAlgorithm field - null if not set.
      Returns:
        the contents of the digestAlgorithm field, or null if not set.

    - #### getHashTreeLeaf

          public PartialHashtree getHashTreeLeaf()

      Return the first node in the reduced hash tree which contains the leaf node.
      Returns:
        the node containing the data hashes, null if no reduced hash tree is present.

    - #### getReducedHashTree

          public PartialHashtree[] getReducedHashTree()

    - #### getTimeStamp

          public ContentInfo getTimeStamp()

    - #### toASN1Primitive

          public ASN1Primitive toASN1Primitive()

      Description copied from class: `ASN1Object`
      Method providing a primitive representation of this object suitable for encoding.
      Specified by:
        `toASN1Primitive` in interface `ASN1Encodable`
      Specified by:
        `toASN1Primitive` in class `ASN1Object`
      Returns:
        a primitive representation of this object.