Top Description Fields Constructors Methods
org.bouncycastle.asn1

public abstract Class ASN1External

extends ASN1Primitive
Class Inheritance
Known Direct Subclasses
org.bouncycastle.asn1.DERExternal, org.bouncycastle.asn1.DLExternal
Imports
java.io.IOException, org.bouncycastle.util.Objects

Class representing the DER-type External

Field Summary

Modifier and TypeField and Description
pack-priv ASN1Primitive
pack-priv ASN1ObjectIdentifier
pack-priv int
pack-priv ASN1Primitive
pack-priv ASN1Integer
pack-priv static final ASN1UniversalType

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
ASN1External(ASN1ObjectIdentifier directReference, ASN1Integer indirectReference, ASN1Primitive dataValueDescriptor, DERTaggedObject externalData)

pack-priv
ASN1External(ASN1ObjectIdentifier directReference, ASN1Integer indirectReference, ASN1Primitive dataValueDescriptor, int encoding, ASN1Primitive externalData)

Method Summary

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

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

Equality (similarity) comparison for two ASN1Primitive objects.
pack-priv abstract ASN1Sequence
private static int
checkEncoding(int
The encoding
encoding
)

Checks the encoding of the content.

private static ASN1Primitive
checkExternalContent(int tagNo, ASN1Primitive externalContent)

pack-priv void
encode(ASN1OutputStream out, boolean withTag)

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

pack-priv boolean
encodeConstructed()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encodeConstructed.

Return true if this objected is a CONSTRUCTED one, false otherwise.
pack-priv int
public ASN1Primitive

Returns:

The descriptor
getDataValueDescriptor
()

Returns the data value descriptor

public ASN1ObjectIdentifier

Returns:

The reference
getDirectReference
()

Returns the direct reference of the external element

public int

Returns:

The encoding
getEncoding
()

Returns the encoding of the content.

public ASN1Primitive

Returns:

The content
getExternalContent
()

Returns the content of this element

private static ASN1Primitive
public ASN1Integer

Returns:

The reference
getIndirectReference
()

Returns the indirect reference of this element

public static ASN1External
public static ASN1External
getInstance(ASN1TaggedObject taggedObject, boolean explicit)

private static ASN1Primitive
getObjFromSequence(ASN1Sequence sequence, int index)

public int
hashCode()

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

Returns a hash code value for the object.
pack-priv ASN1Primitive
toDERObject()

Overrides org.bouncycastle.asn1.ASN1Primitive.toDERObject.

Return the current object as one which encodes using Distinguished Encoding Rules.
pack-priv ASN1Primitive
toDLObject()

Overrides org.bouncycastle.asn1.ASN1Primitive.toDLObject.

Return the current object as one which encodes using Definite Length encoding.
Inherited from org.bouncycastle.asn1.ASN1Primitive:
encodeToencodeToequalsequalsequalsfromByteArraytoASN1Primitive

Field Detail

dataValueDescriptorback to summary
pack-priv ASN1Primitive dataValueDescriptor
directReferenceback to summary
pack-priv ASN1ObjectIdentifier directReference
encodingback to summary
pack-priv int encoding
externalContentback to summary
pack-priv ASN1Primitive externalContent
indirectReferenceback to summary
pack-priv ASN1Integer indirectReference
TYPEback to summary
pack-priv static final ASN1UniversalType TYPE

Constructor Detail

ASN1Externalback to summary
pack-priv ASN1External(ASN1Sequence sequence)
ASN1Externalback to summary
pack-priv ASN1External(ASN1ObjectIdentifier directReference, ASN1Integer indirectReference, ASN1Primitive dataValueDescriptor, DERTaggedObject externalData)
ASN1Externalback to summary
pack-priv ASN1External(ASN1ObjectIdentifier directReference, ASN1Integer indirectReference, ASN1Primitive dataValueDescriptor, int encoding, ASN1Primitive externalData)

Method Detail

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

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

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

Equality (similarity) comparison for two ASN1Primitive objects.

buildSequenceback to summary
pack-priv abstract ASN1Sequence buildSequence()
checkEncodingback to summary
private static int checkEncoding(int encoding)

Checks the encoding of the content. Valid values are

  • 0 single-ASN1-type
  • 1 OCTET STRING
  • 2 BIT STRING
Parameters
encoding:int

The encoding

checkExternalContentback to summary
private static ASN1Primitive checkExternalContent(int tagNo, ASN1Primitive externalContent)
encodeback to summary
pack-priv void encode(ASN1OutputStream out, boolean withTag) throws IOException

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

encodeConstructedback to summary
pack-priv boolean encodeConstructed()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encodeConstructed.

Doc from org.bouncycastle.asn1.ASN1Primitive.encodeConstructed.

Return true if this objected is a CONSTRUCTED one, false otherwise.

Returns:boolean

true if CONSTRUCTED bit set on object's tag, false otherwise.

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

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

getDataValueDescriptorback to summary
public ASN1Primitive getDataValueDescriptor()

Returns the data value descriptor

Returns:ASN1Primitive

The descriptor

getDirectReferenceback to summary
public ASN1ObjectIdentifier getDirectReference()

Returns the direct reference of the external element

Returns:ASN1ObjectIdentifier

The reference

getEncodingback to summary
public int getEncoding()

Returns the encoding of the content. Valid values are

  • 0 single-ASN1-type
  • 1 OCTET STRING
  • 2 BIT STRING
Returns:int

The encoding

getExternalContentback to summary
public ASN1Primitive getExternalContent()

Returns the content of this element

Returns:ASN1Primitive

The content

getExternalContentback to summary
private static ASN1Primitive getExternalContent(ASN1TaggedObject encoding)
getIndirectReferenceback to summary
public ASN1Integer getIndirectReference()

Returns the indirect reference of this element

Returns:ASN1Integer

The reference

getInstanceback to summary
public static ASN1External getInstance(Object obj)
getInstanceback to summary
public static ASN1External getInstance(ASN1TaggedObject taggedObject, boolean explicit)
getObjFromSequenceback to summary
private static ASN1Primitive getObjFromSequence(ASN1Sequence sequence, int index)
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 the 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.

toDERObjectback to summary
pack-priv ASN1Primitive toDERObject()

Overrides org.bouncycastle.asn1.ASN1Primitive.toDERObject.

Doc from org.bouncycastle.asn1.ASN1Primitive.toDERObject.

Return the current object as one which encodes using Distinguished Encoding Rules.

Returns:ASN1Primitive

a DER version of this.

toDLObjectback to summary
pack-priv ASN1Primitive toDLObject()

Overrides org.bouncycastle.asn1.ASN1Primitive.toDLObject.

Doc from org.bouncycastle.asn1.ASN1Primitive.toDLObject.

Return the current object as one which encodes using Definite Length encoding.

Returns:ASN1Primitive

a DL version of this.