Class ASN1Primitive

java.lang.Object
org.bouncycastle.asn1.ASN1Object
org.bouncycastle.asn1.ASN1Primitive
All Implemented Interfaces:
ASN1Encodable, Encodable
Direct Known Subclasses:
ASN1Absent, ASN1ApplicationSpecific, ASN1BitString, ASN1Boolean, ASN1Enumerated, ASN1External, ASN1GeneralizedTime, ASN1Integer, ASN1Null, ASN1ObjectIdentifier, ASN1OctetString, ASN1Sequence, ASN1Set, ASN1TaggedObject, ASN1UTCTime, DERBMPString, DERGeneralString, DERGraphicString, DERIA5String, DERNumericString, DERPrintableString, DERT61String, DERUniversalString, DERUTF8String, DERVideotexString, DERVisibleString

public abstract class ASN1Primitive extends ASN1Object
Base class for ASN.1 primitive objects. These are the actual objects used to generate byte encodings.
  • Method Details

    • fromByteArray

      public static ASN1Primitive fromByteArray(byte[] data) throws IOException
      Create a base ASN.1 object from a byte stream.
      Parameters:
      data - the byte stream to parse.
      Returns:
      the base ASN.1 object represented by the byte stream.
      Throws:
      IOException - if there is a problem parsing the data, or parsing the stream did not exhaust the available data.
    • equals

      public final boolean equals(Object o)
      Overrides:
      equals in class ASN1Object
    • 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.
    • hashCode

      public abstract int hashCode()
      Overrides:
      hashCode in class ASN1Object