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

Class representing the DER-type External

Field Summary

Modifier and TypeField and Description
protected ASN1Primitive
protected ASN1ObjectIdentifier
protected int
protected int
protected ASN1Primitive
protected ASN1Integer

Constructor Summary

AccessConstructor and Description
public
ASN1External(ASN1EncodableVector vector)

Construct an EXTERNAL object, the input encoding vector must have exactly two elements on it.

public
ASN1External(ASN1ObjectIdentifier
The direct reference or null if not set.
directReference
,
ASN1Integer
The indirect reference or null if not set.
indirectReference
,
ASN1Primitive
The data value descriptor or null if not set.
dataValueDescriptor
,
DERTaggedObject
The external data in its encoded form.
externalData
)

Creates a new instance of External See X.690 for more informations about the meaning of these parameters

public
ASN1External(ASN1ObjectIdentifier
The direct reference or null if not set.
directReference
,
ASN1Integer
The indirect reference or null if not set.
indirectReference
,
ASN1Primitive
The data value descriptor or null if not set.
dataValueDescriptor
,
int
The encoding to be used for the external data
encoding
,
ASN1Primitive
The external data
externalData
)

Creates a new instance of External.

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 int
encodedLength()

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

Return the length of the encoding this object will produce.
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

public ASN1Integer

Returns:

The reference
getIndirectReference
()

Returns the indirect reference of this element

private ASN1Primitive
public int
hashCode()

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

Returns a hash code value for this object.
pack-priv boolean
isConstructed()

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

Return true if this objected is a CONSTRUCTED one, false otherwise.
private void
setDataValueDescriptor(ASN1Primitive
The descriptor
dataValueDescriptor
)

Sets the data value descriptor

private void
setDirectReference(ASN1ObjectIdentifier
The reference
directReferemce
)

Sets the direct reference of the external element

private void
setEncoding(int
The encoding
encoding
)

Sets the encoding of the content.

private void
setExternalContent(ASN1Primitive
The content
externalContent
)

Sets the content of this element

private void
setIndirectReference(ASN1Integer
The reference
indirectReference
)

Sets the indirect reference of this element

pack-priv ASN1Primitive
toDERObject()

Overrides org.bouncycastle.asn1.ASN1Primitive.toDERObject.

Return the current object as one which encodes using Distinguished Encoding Rules.
Inherited from org.bouncycastle.asn1.ASN1Primitive:
encodeequalsfromByteArraytoASN1PrimitivetoDLObject

Field Detail

dataValueDescriptorback to summary
protected ASN1Primitive dataValueDescriptor
directReferenceback to summary
protected ASN1ObjectIdentifier directReference
encodedLenback to summary
protected int encodedLen
encodingback to summary
protected int encoding
externalContentback to summary
protected ASN1Primitive externalContent
indirectReferenceback to summary
protected ASN1Integer indirectReference

Constructor Detail

ASN1Externalback to summary
public ASN1External(ASN1EncodableVector vector)

Construct an EXTERNAL object, the input encoding vector must have exactly two elements on it.

Acceptable input formats are:

Exceptions
IllegalArgumentException:
if input size is wrong, or
ASN1Externalback to summary
public ASN1External(ASN1ObjectIdentifier directReference, ASN1Integer indirectReference, ASN1Primitive dataValueDescriptor, DERTaggedObject externalData)

Creates a new instance of External See X.690 for more informations about the meaning of these parameters

Parameters
directReference:ASN1ObjectIdentifier

The direct reference or null if not set.

indirectReference:ASN1Integer

The indirect reference or null if not set.

dataValueDescriptor:ASN1Primitive

The data value descriptor or null if not set.

externalData:DERTaggedObject

The external data in its encoded form.

ASN1Externalback to summary
public ASN1External(ASN1ObjectIdentifier directReference, ASN1Integer indirectReference, ASN1Primitive dataValueDescriptor, int encoding, ASN1Primitive externalData)

Creates a new instance of External. See X.690 for more informations about the meaning of these parameters

Parameters
directReference:ASN1ObjectIdentifier

The direct reference or null if not set.

indirectReference:ASN1Integer

The indirect reference or null if not set.

dataValueDescriptor:ASN1Primitive

The data value descriptor or null if not set.

encoding:int

The encoding to be used for the external data

externalData:ASN1Primitive

The external data

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.

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.
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

getIndirectReferenceback to summary
public ASN1Integer getIndirectReference()

Returns the indirect reference of this element

Returns:ASN1Integer

The reference

getObjFromVectorback to summary
private ASN1Primitive getObjFromVector(ASN1EncodableVector v, 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 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
pack-priv boolean isConstructed()

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

Doc from org.bouncycastle.asn1.ASN1Primitive.isConstructed.

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

Returns:boolean

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

setDataValueDescriptorback to summary
private void setDataValueDescriptor(ASN1Primitive dataValueDescriptor)

Sets the data value descriptor

Parameters
dataValueDescriptor:ASN1Primitive

The descriptor

setDirectReferenceback to summary
private void setDirectReference(ASN1ObjectIdentifier directReferemce)

Sets the direct reference of the external element

Parameters
directReferemce:ASN1ObjectIdentifier

The reference

setEncodingback to summary
private void setEncoding(int encoding)

Sets the encoding of the content. Valid values are

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

The encoding

setExternalContentback to summary
private void setExternalContent(ASN1Primitive externalContent)

Sets the content of this element

Parameters
externalContent:ASN1Primitive

The content

setIndirectReferenceback to summary
private void setIndirectReference(ASN1Integer indirectReference)

Sets the indirect reference of this element

Parameters
indirectReference:ASN1Integer

The reference

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.