public class SET extends ConstructedType
A SET object is DER encoded using the constructed encoding practice
by splitting it into separately encoded components. Therefore the SEQUENCE
class is extended to be a subclass of the
ConstructedType class. Each component can be added to the current SET object
by using a proper
addComponent method of the
ConstructedType super class.
The constructed form can be recognized by bit 6 of the (first) identifier octet(s) of the DER encoded bit stream, which is set to 1.
The following example creates a new SET object and adds an INTERGER, BOOLEAN, and a PrintableString component:
SET set = new SET(); set.addComponent(new INTEGER(3)); set.addComponent(new BOOLEAN(true)); set.addComponent(new PrintableString("Test"));Of course, sets may be nested meaning that one SET contains another SET as one of its components. The nesting may be of any depth.
|Modifier and Type||Field and Description|
|Constructor and Description|
Creates a new SET.
Creates a new SET.
|Modifier and Type||Method and Description|
DER encodes this ASN1Object and writes the result to the supplied OutputStream.
Returns a String that represents the value of this SET.
addComponent, addComponent, addEncodeListener, clone, countComponents, decode, getComponentAt, getComponents, getValue, removeComponent, removeComponent, setComponent, setValue
addEncodeListener, encodeObject, getAsnType, indefiniteLength, isA, isConstructed, isStringType, setIndefiniteLength
public SET(boolean sorted)
sortedis set to
truethe components are sorted by their encodings. This constructor only shall be used for creating SET OF structures where all components have the same type. In this way, an application may prefer to call the
createSetOf(ASN1Type array, boolean sorted)method of class
ASNfor creating the SET OF.
sorted- whether to sort the components by their encodings or not
public java.lang.String toString()
protected void encode(java.io.OutputStream os) throws java.io.IOException