const CLASS_UNIVERSAL
pub const CLASS_UNIVERSAL = 0Purpose
Constant CLASS_UNIVERSAL, defining protocol or algorithm parameters.
#encoding/asn1DER TLV; INTEGER fits in i64.
const CLASS_UNIVERSALpub const CLASS_UNIVERSAL = 0Constant CLASS_UNIVERSAL, defining protocol or algorithm parameters.
const CLASS_CONTEXTpub const CLASS_CONTEXT = 2Constant CLASS_CONTEXT, defining protocol or algorithm parameters.
const TAG_BOOLEANpub const TAG_BOOLEAN = 1Constant TAG_BOOLEAN, defining protocol or algorithm parameters.
const TAG_INTEGERpub const TAG_INTEGER = 2Constant TAG_INTEGER, defining protocol or algorithm parameters.
const TAG_BIT_STRINGpub const TAG_BIT_STRING = 3Constant TAG_BIT_STRING, defining protocol or algorithm parameters.
const TAG_OCTET_STRINGpub const TAG_OCTET_STRING = 4Constant TAG_OCTET_STRING, defining protocol or algorithm parameters.
const TAG_NULLpub const TAG_NULL = 5Constant TAG_NULL, defining protocol or algorithm parameters.
const TAG_OIDpub const TAG_OID = 6Constant TAG_OID, defining protocol or algorithm parameters.
const TAG_UTF8_STRINGpub const TAG_UTF8_STRING = 12Constant TAG_UTF8_STRING, defining protocol or algorithm parameters.
const TAG_SEQUENCEpub const TAG_SEQUENCE = 16Constant TAG_SEQUENCE, defining protocol or algorithm parameters.
const TAG_SETpub const TAG_SET = 17Constant TAG_SET, defining protocol or algorithm parameters.
const TAG_PRINTABLE_STRINGpub const TAG_PRINTABLE_STRING = 19Constant TAG_PRINTABLE_STRING, defining protocol or algorithm parameters.
const TAG_IA5_STRINGpub const TAG_IA5_STRING = 22Constant TAG_IA5_STRING, defining protocol or algorithm parameters.
const TAG_UTC_TIMEpub const TAG_UTC_TIME = 23Constant TAG_UTC_TIME, defining protocol or algorithm parameters.
const TAG_GENERALIZED_TIMEpub const TAG_GENERALIZED_TIME = 24Constant TAG_GENERALIZED_TIME, defining protocol or algorithm parameters.
struct Valuepub struct Value {
pub class int
pub constructed int
pub tag int
pub bytes string
pub rest string
}Structure encapsulating class, constructed, tag, bytes, rest.
class intconstructed inttag intbytes stringrest stringstruct Decoderpub struct Decoder {
pub data string
pub pos int
}Structure encapsulating data, pos.
data stringpos intnew_decoderpub fn new_decoder(data &string) DecoderConstruct decoder.
data &stringDecoder — a value of this type
marshal_boolpub fn marshal_bool(v bool) stringMarshal bool.
v boolstring — result string
marshal_nullpub fn marshal_null() stringMarshal null.
No arguments are required.
string — result string
marshal_octetpub fn marshal_octet(s &string) stringMarshal octet.
s &stringstring — result string
marshal_utf8pub fn marshal_utf8(s &string) stringMarshal utf8.
s &stringstring — result string
marshal_bit_stringpub fn marshal_bit_string(s &string) stringMarshal bit string.
s &stringstring — result string
marshal_intpub fn marshal_int(n int) stringMarshal int.
n intstring — result string
marshal_oidpub fn marshal_oid(arcs &[]int) stringMarshal oid. Throws on failure; handle the error or propagate it to the caller.
arcs &[]intstring — result string
marshal_seqpub fn marshal_seq(elems &[]string) stringMarshal seq.
elems &[]stringstring — result string
unmarshalpub fn unmarshal(data &string) ValueExecute unmarshal. Throws on failure; handle the error or propagate it to the caller.
data &stringValue — a value of this type
parse_atpub fn parse_at(data &string, off int) ValueParse as at. Throws on failure; handle the error or propagate it to the caller.
data &stringoff intValue — a value of this type
(Decoder) donepub fn (d Decoder) done() boolExecute done on Decoder.
d DecoderDecoder instance used by this call (value receiver).bool — true or false
(Value) as_bit_stringpub fn (v Value) as_bit_string() stringOperation on Value: as bit string. Throws on failure; handle the error or propagate it to the caller.
v ValueValue instance used by this call (value receiver).string — result string
($&Decoder) nextpub fn (d $&Decoder) next() ValueOperation on $&Decoder: take the next item, or end according to this type. Throws on failure; handle the error or propagate it to the caller.
d $&DecoderDecoder instance used by this call (exclusive borrow).Value — a value of this type
(Value) as_boolpub fn (v Value) as_bool() boolOperation on Value: as bool. Throws on failure; handle the error or propagate it to the caller.
v ValueValue instance used by this call (value receiver).bool — true or false
(Value) as_intpub fn (v Value) as_int() intOperation on Value: as int. Throws on failure; handle the error or propagate it to the caller.
v ValueValue instance used by this call (value receiver).int — a value of this type
(Value) as_octetpub fn (v Value) as_octet() stringOperation on Value: as octet. Throws on failure; handle the error or propagate it to the caller.
v ValueValue instance used by this call (value receiver).string — result string
(Value) as_utf8pub fn (v Value) as_utf8() stringOperation on Value: as utf8. Throws on failure; handle the error or propagate it to the caller.
v ValueValue instance used by this call (value receiver).string — result string
(Value) as_nullpub fn (v Value) as_null() boolOperation on Value: as null. Throws on failure; handle the error or propagate it to the caller.
v ValueValue instance used by this call (value receiver).bool — true or false
(Value) as_oidpub fn (v Value) as_oid() []intOperation on Value: as oid. Throws on failure; handle the error or propagate it to the caller.
v ValueValue instance used by this call (value receiver).[]int — slice result