AsnObjBuilder
class AsnObjBuilder : Obj
Utility to build an AsnObj
Create an ASN.1 SET value The items parameter may be any of the values accepted by seq
Build an ASN.1 Boolean value
Build an ASN.1 UTCTime value
Build an ASN.1 Utf8String value
Build an ASN.1 Bit String value
Build an ASN.1 Object Identifier value (OID)
Build an ASN.1 GeneralizedTime value
Build an ASN.1 Null value
Build an ASN.1 Integer value
Build one of the ASN.1 string types
Build an ASN.1 Enumerated value
Build an ASN.1 Octet String value
Add a tag to the object builder
Build an ASN.1 SEQUENCE value The items parameter may be
AsnObj asnEnum(Int val)
Build an ASN.1 Enumerated value.
AsnObj asnNull()
Build an ASN.1 Null value
AsnObj bits(Buf bits)
Build an ASN.1 Bit String value. The bits in the bit string are numbered from left to right. For example, bits 0-7 are in the first byte of the bits buffer.
AsnObj bool(Bool val)
Build an ASN.1 Boolean value
AsnObj genTime(DateTime ts)
Build an ASN.1 GeneralizedTime value.
AsnObj int(Obj val)
Build an ASN.1 Integer value. The val may be either an Int or a BigInt, but is always normalized to BigInt.
new make()
AsnObj octets(Obj val)
Build an ASN.1 Octet String value. The val may be:
- a
Str- it will be converted to a Buf as((Str)val).toBuf - a
Bufcontaining the raw octets
AsnOid oid(Obj val)
Build an ASN.1 Object Identifier value (OID). The val may be:
- an
Int[]where each element of the list is a part of the oid. - a
Strwhere each part of the oid is separated by..
Asn.oid([1,2,3])
Asn.oid("1.2.3")
AsnSeq seq(Obj items)
Build an ASN.1 SEQUENCE value The items parameter may be:
- An
AsnItem[]of raw items to add to the collection - An
AsnObj[] - A
Str:AsnObj- if the order of the sequence is important, you should ensure the map is ordered.
AsnSet set(Obj items)
Create an ASN.1 SET value The items parameter may be any of the values accepted by seq.
AsnObj str(Str val, AsnTag univ)
Build one of the ASN.1 string types. The univ parameter must be one of:
See utf8 to easily create UTF-8 strings.
This tag(AsnTag? tag)
Add a tag to the object builder. Tags should be added in ther order they are specified in an ASN.1 type declaration. If the tag is null, then this is a no-op.
Whenever a concrete AsnObj is built, the builder will clear all tags.
// [0] [1 APPLICATION] Boolean obj := AsnObjBuilder() .tag(AsnTag.context(0).implicit) .tag(AsnTag.app(1).implicit) .bool(true)
AsnObj utc(DateTime ts)
Build an ASN.1 UTCTime value
AsnObj utf8(Str val)
Build an ASN.1 Utf8String value.