Top Description Fields Constructors Methods
org.bouncycastle.asn1

public Class BERSet

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

Indefinite length SET and SET OF constructs.

Note

This does not know which syntax the set is!

Length field has value 0x80, and the set ends with two bytes of: 0x00, 0x00.

For X.690 syntax rules, see ASN1Set.

In brief: Constructing this form does not sort the supplied elements, nor does the sorting happen before serialization. This is different from the way DERSet does things.

Field Summary

Inherited from org.bouncycastle.asn1.ASN1Set:
sortedElements

Constructor Summary

AccessConstructor and Description
public
BERSet()

Create an empty SET.

public
BERSet(ASN1Encodable
- a single object that makes up the set.
obj
)

Create a SET containing one object.

public
BERSet(ASN1EncodableVector
a vector of objects making up the set.
v
)

Create a SET containing multiple objects.

public
BERSet(ASN1Encodable[]
an array of ASN.1 objects.
a
)

Create a SET from an array of objects.

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.
Inherited from org.bouncycastle.asn1.ASN1Set:
asn1EqualsgetInstancegetInstancegetObjectAtgetObjectshashCodeisConstructediteratorparsersizesorttoArraytoDERObjecttoDLObjecttoString

Constructor Detail

BERSetback to summary
public BERSet()

Create an empty SET.

BERSetback to summary
public BERSet(ASN1Encodable obj)

Create a SET containing one object.

Parameters
obj:ASN1Encodable

- a single object that makes up the set.

BERSetback to summary
public BERSet(ASN1EncodableVector v)

Create a SET containing multiple objects.

Parameters
v:ASN1EncodableVector

a vector of objects making up the set.

BERSetback to summary
public BERSet(ASN1Encodable[] a)

Create a SET from an array of objects.

Parameters
a:ASN1Encodable[]

an array of ASN.1 objects.

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.