Top Description Fields Constructors Methods
org.bouncycastle.asn1

public Class DERSet

extends ASN1Set
Class Inheritance
Imports
java.io.IOException, java.util.Enumeration

A DER encoded SET object

For X.690 syntax rules, see ASN1Set.

For short: Constructing this form does sort the supplied elements, and the sorting happens also before serialization (if necesssary). This is different from the way BERSet,DLSet does things.

Field Summary

Modifier and TypeField and Description
private int
Inherited from org.bouncycastle.asn1.ASN1Set:
sortedElements

Constructor Summary

AccessConstructor and Description
public
DERSet()

create an empty set

public
DERSet(ASN1Encodable
the object to go in the set
obj
)

create a set containing one object

public
DERSet(ASN1EncodableVector
the vector of objects to make up the set.
v
)

create a set containing a vector of objects.

public
DERSet(ASN1Encodable[]
the array of objects to make up the set.
a
)

create a set containing an array of objects.

pack-priv
DERSet(ASN1EncodableVector v, boolean doSort)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv int
encodedLength()

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

Return the length of the encoding this object will produce.
private int
Inherited from org.bouncycastle.asn1.ASN1Set:
asn1EqualsgetInstancegetInstancegetObjectAtgetObjectshashCodeisConstructediteratorparsersizesorttoArraytoDERObjecttoDLObjecttoString

Field Detail

bodyLengthback to summary
private int bodyLength

Constructor Detail

DERSetback to summary
public DERSet()

create an empty set

DERSetback to summary
public DERSet(ASN1Encodable obj)

create a set containing one object

Parameters
obj:ASN1Encodable

the object to go in the set

DERSetback to summary
public DERSet(ASN1EncodableVector v)

create a set containing a vector of objects.

Parameters
v:ASN1EncodableVector

the vector of objects to make up the set.

DERSetback to summary
public DERSet(ASN1Encodable[] a)

create a set containing an array of objects.

Parameters
a:ASN1Encodable[]

the array of objects to make up the set.

DERSetback to summary
pack-priv DERSet(ASN1EncodableVector v, boolean doSort)

Method Detail

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

Implements abstract org.bouncycastle.asn1.ASN1Set.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.
getBodyLengthback to summary
private int getBodyLength() throws IOException