Top Description Fields Constructors Methods
org.bouncycastle.asn1

public abstract Class ASN1ApplicationSpecific

extends ASN1Primitive
Class Inheritance
Known Direct Subclasses
org.bouncycastle.asn1.DLApplicationSpecific, org.bouncycastle.asn1.BERApplicationSpecific, org.bouncycastle.asn1.DERApplicationSpecific
Imports
java.io.IOException, org.bouncycastle.util.Arrays, org.bouncycastle.util.encoders.Hex

Base class for an ASN.1 ApplicationSpecific object

Field Summary

Modifier and TypeField and Description
protected final boolean
protected final byte[]
protected final int

Constructor Summary

AccessConstructor and Description
pack-priv
ASN1ApplicationSpecific(boolean isConstructed, int tag, byte[] octets)

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
asn1Equals(ASN1Primitive o)

Implements abstract org.bouncycastle.asn1.ASN1Primitive.asn1Equals.

Equality (similarity) comparison for two ASN1Primitive objects.
pack-priv void
pack-priv int
encodedLength()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encodedLength.

Return the length of the encoding this object will produce.
public int

Returns:

the application tag number.
getApplicationTag
()

Return the tag number associated with this object,

public byte[]

Returns:

the encoded contents of the object.
getContents
()

Return the contents of this object as a byte[]

public static ASN1ApplicationSpecific

Returns:

obj's representation as an ASN1ApplicationSpecific object.
getInstance
(Object
the object to be converted.
obj
)

Return an ASN1ApplicationSpecific from the passed in object, which may be a byte array, or null.

protected static int
getLengthOfHeader(byte[] data)

public ASN1Primitive

Returns:

the resulting object
getObject
()

Return the enclosed object assuming explicit tagging.

public ASN1Primitive

Returns:

the resulting object
getObject
(int
the type tag that should be applied to the object's contents.
derTagNo
)

Return the enclosed object assuming implicit tagging.

public int
hashCode()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.hashCode.

Returns a hash code value for this object.
public boolean

Returns:

true if constructed, otherwise false.
isConstructed
()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.isConstructed.

Return true if the object is marked as constructed, false otherwise.
private byte[]
replaceTagNumber(int newTag, byte[] input)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.bouncycastle.asn1.ASN1Primitive:
equalsfromByteArraytoASN1PrimitivetoDERObjecttoDLObject

Field Detail

isConstructedback to summary
protected final boolean isConstructed
octetsback to summary
protected final byte[] octets
tagback to summary
protected final int tag

Constructor Detail

ASN1ApplicationSpecificback to summary
pack-priv ASN1ApplicationSpecific(boolean isConstructed, int tag, byte[] octets)

Method Detail

asn1Equalsback to summary
pack-priv boolean asn1Equals(ASN1Primitive o)

Implements abstract org.bouncycastle.asn1.ASN1Primitive.asn1Equals.

Doc from org.bouncycastle.asn1.ASN1Primitive.asn1Equals.

Equality (similarity) comparison for two ASN1Primitive objects.

encodeback to summary
pack-priv void encode(ASN1OutputStream out) throws IOException

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encode.

encodedLengthback to summary
pack-priv int encodedLength() throws IOException

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encodedLength.

Doc from org.bouncycastle.asn1.ASN1Primitive.encodedLength.

Return the length of the encoding this object will produce.

Returns:int

the length of the object's encoding.

Exceptions
IOException:
if the encoding length cannot be calculated.
getApplicationTagback to summary
public int getApplicationTag()

Return the tag number associated with this object,

Returns:int

the application tag number.

getContentsback to summary
public byte[] getContents()

Return the contents of this object as a byte[]

Returns:byte[]

the encoded contents of the object.

getInstanceback to summary
public static ASN1ApplicationSpecific getInstance(Object obj)

Return an ASN1ApplicationSpecific from the passed in object, which may be a byte array, or null.

Parameters
obj:Object

the object to be converted.

Returns:ASN1ApplicationSpecific

obj's representation as an ASN1ApplicationSpecific object.

getLengthOfHeaderback to summary
protected static int getLengthOfHeader(byte[] data)
getObjectback to summary
public ASN1Primitive getObject() throws IOException

Return the enclosed object assuming explicit tagging.

Returns:ASN1Primitive

the resulting object

Exceptions
IOException:
if reconstruction fails.
getObjectback to summary
public ASN1Primitive getObject(int derTagNo) throws IOException

Return the enclosed object assuming implicit tagging.

Parameters
derTagNo:int

the type tag that should be applied to the object's contents.

Returns:ASN1Primitive

the resulting object

Exceptions
IOException:
if reconstruction fails.
hashCodeback to summary
public int hashCode()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

isConstructedback to summary
public boolean isConstructed()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.isConstructed.

Return true if the object is marked as constructed, false otherwise.

Returns:boolean

true if constructed, otherwise false.

replaceTagNumberback to summary
private byte[] replaceTagNumber(int newTag, byte[] input) throws IOException
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object