Class ContentInfo

java.lang.Object
org.bouncycastle.asn1.ASN1Object
org.bouncycastle.asn1.cms.ContentInfo
All Implemented Interfaces:
org.bouncycastle.asn1.ASN1Encodable, CMSObjectIdentifiers, org.bouncycastle.util.Encodable

public class ContentInfo extends org.bouncycastle.asn1.ASN1Object implements CMSObjectIdentifiers
RFC 5652 ContentInfo, and RFC 5652 EncapsulatedContentInfo objects.
 ContentInfo ::= SEQUENCE {
     contentType ContentType,
     content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL
 }

 EncapsulatedContentInfo ::= SEQUENCE {
     eContentType ContentType,
     eContent [0] EXPLICIT OCTET STRING OPTIONAL
 }
 
  • Constructor Details

    • ContentInfo

      public ContentInfo(org.bouncycastle.asn1.ASN1ObjectIdentifier contentType, org.bouncycastle.asn1.ASN1Encodable content)
  • Method Details

    • getInstance

      public static ContentInfo getInstance(Object obj)
      Return an ContentInfo object from the given object.

      Accepted inputs:

      • null → null
      • ContentInfo object
      • ASN1Sequence input formats with ContentInfo structure inside
      Parameters:
      obj - the object we want converted.
      Throws:
      IllegalArgumentException - if the object cannot be converted.
    • getInstance

      public static ContentInfo getInstance(org.bouncycastle.asn1.ASN1TaggedObject obj, boolean explicit)
    • getContentType

      public org.bouncycastle.asn1.ASN1ObjectIdentifier getContentType()
    • getContent

      public org.bouncycastle.asn1.ASN1Encodable getContent()
    • isDefiniteLength

      public boolean isDefiniteLength()
      Return true if this object encapsulates a definite-length structure.
      Returns:
      true if definite-length, false if indefinite.
    • toASN1Primitive

      public org.bouncycastle.asn1.ASN1Primitive toASN1Primitive()
      Produce an object suitable for an ASN1OutputStream.
      Specified by:
      toASN1Primitive in interface org.bouncycastle.asn1.ASN1Encodable
      Specified by:
      toASN1Primitive in class org.bouncycastle.asn1.ASN1Object