SET.Template
This class is used for decoding DER-encoded SETs.
addElement
public void addElement(ASN1Template t)
Adds a sub-template to the end of this SET template. For example,
if the ASN.1 included:
MySet ::= SET {
item SubType,
... }
the "item" element would be added to the MySet template with:
mySet.addElement( new SubType.Template() );
addElement
public void addElement(ASN1Template t,
ASN1Value def)
Adds a sub-template with the given default value to the end
of this SET template. For example, if the ASN.1 included:
MySet ::= SET {
item INTEGER DEFAULT (5),
... }
the "item" element would be added to the MySet template with:
mySet.addElement( new SubType.Template(), new INTEGER(5) );
addElement
public void addElement(Tag implicit,
ASN1Template t)
Adds a sub-template with the given implicit tag to the end of this
SET template. For example, if the ASN.1 included:
MySet ::= SET {
item [0] IMPLICIT SubType,
... }
the "item" element would be added to the MySet template with:
mySet.addElement( new Tag(0), new SubType.Template() );
addElement
public void addElement(Tag implicit,
ASN1Template t,
ASN1Value def)
Adds a sub-template with the given default value and implicit tag to
the end of this SET template. For example, if the ASN.1 included:
MySet ::= SET {
item [0] IMPLICIT INTEGER DEFAULT (5),
... }
the "item" element would be added to the MySet template with:
mySet.addElement( new Tag(0), new SubType.Template(), new INTEGER(5) );
addOptionalElement
public void addOptionalElement(ASN1Template t)
Adds an optional sub-template to the end
of this SET template. For example, if the ASN.1 included:
MySet ::= SET {
item SubType OPTIONAL,
... }
the "item" element would be added to the MySet template with:
mySet.addOptionalElement( new SubType.Template() );
addOptionalElement
public void addOptionalElement(Tag implicit,
ASN1Template t)
Adds an optional sub-template with the given implicit tag to the end
of this SET template. For example, if the ASN.1 included:
MySet ::= SET {
item [0] IMPLICIT SubType OPTIONAL,
... }
the "item" element would be added to the MySet template with:
mySet.addOptionalElement( new Tag(0), new SubType.Template() );
defaultAt
public ASN1Value defaultAt(int index)
Returns the default value for the sub-template at the given index.
May return NULL if no default value was specified.
implicitTagAt
public Tag implicitTagAt(int index)
Returns the implicit tag of the item stored at the given index.
May be NULL if no implicit tag was specified.
insertElementAt
public void insertElementAt(ASN1Template t,
int index)
Inserts the template at the given index.
insertElementAt
public void insertElementAt(ASN1Template t,
ASN1Value def,
int index)
Inserts the template with the given default
value at the given index.
insertElementAt
public void insertElementAt(Tag implicit,
ASN1Template t,
int index)
Inserts the template with the given implicit tag at the given index.
insertElementAt
public void insertElementAt(Tag implicit,
ASN1Template t,
ASN1Value def,
int index)
Inserts the template with the given implicit tag and given default
value at the given index.
insertOptionalElementAt
public void insertOptionalElementAt(ASN1Template t,
int index)
Inserts the optional template at the given index.
insertOptionalElementAt
public void insertOptionalElementAt(Tag implicit,
ASN1Template t,
int index)
Inserts the optional template with the given default
value at the given index.
isOptionalAt
public boolean isOptionalAt(int index)
Returns true
if the sub-template at the given index
is optional.
removeAllElements
public void removeAllElements()
removeElementAt
public void removeElementAt(int index)
size
public int size()
Returns the number of elements in the SET.
tagMatch
public boolean tagMatch(Tag tag)
Determines whether the given tag satisfies this template.
- tagMatch in interface ASN1Template
templateAt
public ASN1Template templateAt(int index)
Returns the sub-template stored at the given index.