org.mozilla.jss.asn1
Class CHOICE
java.lang.Object
org.mozilla.jss.asn1.CHOICE
- ASN1Value
public class CHOICE
extends java.lang.Object
Objects of this class are generated by CHOICE.Template.decode(). It is
not necessary to use them to encode a CHOICE. Since the encoding of a
CHOICE is simply the encoding of the chosen element, it is easier
to just write out the chosen element.
CHOICE(ASN1Value val) - Create a CHOICE whose chosen element has no implicit tag.
|
CHOICE(Tag implicitTag, ASN1Value val) - Create a CHOICE whose chosen element has an implicit tag.
|
void | encode(OutputStream ostream) - Encodes this CHOICE.
|
void | encode(Tag implicitTag, OutputStream ostream) - Encodes this CHOICE.
|
Tag | getTag() - Returns the tag that the chosen element is encoded with, which is
either the underlying tag of the element or an implicit tag.
|
static CHOICE.Template | getTemplate()
|
ASN1Value | getValue() - Returns the chosen value.
|
CHOICE
public CHOICE(ASN1Value val)
Create a CHOICE whose chosen element has no implicit tag.
CHOICE
public CHOICE(Tag implicitTag,
ASN1Value val)
Create a CHOICE whose chosen element has an implicit tag.
encode
public void encode(OutputStream ostream)
throws IOException
Encodes this CHOICE. This merely consists of encoding the chosen
element with an implicit tag, if one was given in the constructor,
or with its own underlying tag.
- encode in interface ASN1Value
encode
public void encode(Tag implicitTag,
OutputStream ostream)
throws IOException
Encodes this CHOICE. This merely consists of encoding the chosen
element with an implicit tag, if one was given in the constructor,
or with its own underlying tag.
- encode in interface ASN1Value
implicitTag
- This value is ignored. The tag of a CHOICE
is merely the tag of the chosen element of the CHOICE. A
CHOICE cannot itself have an implicit tag.
getTag
public Tag getTag()
Returns the tag that the chosen element is encoded with, which is
either the underlying tag of the element or an implicit tag.
- getTag in interface ASN1Value
getValue
public ASN1Value getValue()
Returns the chosen value.