org.mozilla.jss.asn1

Class CHOICE.Template

public static class CHOICE.Template extends Object implements ASN1Template

A Template for decoding ASN.1 CHOICEs
Constructor Summary
Template()
Creates an empty CHOICE template
Method Summary
voidaddElement(ASN1Template template)
Adds a new sub-template to this CHOICE template with no implicit tag.
voidaddElement(Tag implicitTag, ASN1Template template)
Adds a new sub-template to this CHOICE template with an implicit tag.
ASN1Valuedecode(InputStream istream)
ASN1Valuedecode(Tag implicitTag, InputStream istream)
Decodes a CHOICE.
ASN1TemplateelementAt(int index)
Retrieves the element at the specified index.
TagimplicitTagAt(int index)
Retrieves the implicit tag of the element at the specified index.
voidremoveAllElements()
Empties this CHOICE template.
voidremoveElementAt(int index)
Removes the element at the specified index.
intsize()
Returns the number of elements in this CHOICE template.
booleantagMatch(Tag t)
Determines whether the given tag will satisfy this template.

Constructor Detail

Template

public Template()
Creates an empty CHOICE template

Method Detail

addElement

public void addElement(ASN1Template template)
Adds a new sub-template to this CHOICE template with no implicit tag.

addElement

public void addElement(Tag implicitTag, ASN1Template template)
Adds a new sub-template to this CHOICE template with an implicit tag.

decode

public ASN1Value decode(InputStream istream)

decode

public ASN1Value decode(Tag implicitTag, InputStream istream)
Decodes a CHOICE.

Parameters: implicitTag This parameter is ignored. A choice cannot have an implicit tag.

elementAt

public ASN1Template elementAt(int index)
Retrieves the element at the specified index.

implicitTagAt

public Tag implicitTagAt(int index)
Retrieves the implicit tag of the element at the specified index. Returns null if there is no implicit tag for this element.

removeAllElements

public void removeAllElements()
Empties this CHOICE template.

removeElementAt

public void removeElementAt(int index)
Removes the element at the specified index.

size

public int size()
Returns the number of elements in this CHOICE template.

tagMatch

public boolean tagMatch(Tag t)
Determines whether the given tag will satisfy this template. For a CHOICE, this is true if the tag satisfies any sub-template.