Package org.mozilla.jss.asn1
Class SEQUENCE.OF_Template
- java.lang.Object
-
- org.mozilla.jss.asn1.SEQUENCE.OF_Template
-
- All Implemented Interfaces:
ASN1Template
- Enclosing class:
- SEQUENCE
public static class SEQUENCE.OF_Template extends java.lang.Object implements ASN1Template
A Template for decoding SEQUENCE OF values. The main difference between a SEQUENCE.Template and a SEQUENCE.OF_Template is that a regular template specifies the exact ordering, number, and type of elements of the sequence, while an OF_Template has an indefinite number of elements, all the same type. For example, given:MyType ::= SEQUENCE OF Extension
a MyType could be decoded with:SEQUENCE.OF_Template myTypeTemplate = new SEQUENCE.OF_Template( new Extension.Template) ); SEQUENCE seq = (SEQUENCE) myTypeTemplate.decode(someInputStream);
The number ofExtension
s actually decoded could be found withseq.size()
.
-
-
Constructor Summary
Constructors Constructor Description OF_Template(ASN1Template type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ASN1Value
decode(java.io.InputStream istream)
Decodes a SEQUENCE OF from an input stream.ASN1Value
decode(Tag implicitTag, java.io.InputStream istream)
Decodes a SEQUENCE OF with an implicit tag from an input stream.static SEQUENCE.OF_Template
makeOutputlessOFTemplate(ASN1Template type)
boolean
tagMatch(Tag tag)
Determines whether the given tag will satisfy this template.
-
-
-
Constructor Detail
-
OF_Template
public OF_Template(ASN1Template type)
-
-
Method Detail
-
makeOutputlessOFTemplate
public static SEQUENCE.OF_Template makeOutputlessOFTemplate(ASN1Template type)
-
tagMatch
public boolean tagMatch(Tag tag)
Description copied from interface:ASN1Template
Determines whether the given tag will satisfy this template.- Specified by:
tagMatch
in interfaceASN1Template
- Parameters:
tag
- Tag.- Returns:
- True if the given tag will satisfy this template.
-
decode
public ASN1Value decode(java.io.InputStream istream) throws java.io.IOException, InvalidBERException
Decodes a SEQUENCE OF from an input stream.- Specified by:
decode
in interfaceASN1Template
- Parameters:
istream
- Must support marking (markSupported() == true). For example, ByteArrayInputStream and BufferedInputStream support marking, but FileInputStream does not. If your source does not support marking, you can wrap it in a BufferedInputStream.- Returns:
- ASN.1 value.
- Throws:
java.io.IOException
- If other error occurred.InvalidBERException
- If there is an invalid BER encoding.
-
decode
public ASN1Value decode(Tag implicitTag, java.io.InputStream istream) throws java.io.IOException, InvalidBERException
Decodes a SEQUENCE OF with an implicit tag from an input stream.- Specified by:
decode
in interfaceASN1Template
- Parameters:
implicitTag
- Implicit tag.istream
- Must support marking (markSupported() == true). For example, ByteArrayInputStream and BufferedInputStream support marking, but FileInputStream does not. If your source does not support marking, you can wrap it in a BufferedInputStream.- Returns:
- ASN.1 value.
- Throws:
java.io.IOException
- If other error occurred.InvalidBERException
- If there is an invalid BER encoding.
-
-