-
Notifications
You must be signed in to change notification settings - Fork 22
/
asn_type.go
39 lines (29 loc) · 934 Bytes
/
asn_type.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package aper
import (
"reflect"
)
// BIT STRING
// BitString is for an ASN.1 BIT STRING type, BitLength means the effective bits.
type BitString struct {
Bytes []byte // bits packed into bytes.
BitLength uint64 // length in bits.
}
// OCTET STRING
// OctetString is for an ASN.1 OCTET STRING type
type OctetString []byte
// OBJECT IDENTIFIER
// ObjectIdentifier is for an ASN.1 OBJECT IDENTIFIER type
type ObjectIdentifier []byte
// ENUMERATED
// An Enumerated is represented as a plain uint64.
type Enumerated uint64
var (
// BitStringType is the type of BitString
BitStringType = reflect.TypeOf(BitString{})
// OctetStringType is the type of OctetString
OctetStringType = reflect.TypeOf(OctetString{})
// ObjectIdentifierType is the type of ObjectIdentify
ObjectIdentifierType = reflect.TypeOf(ObjectIdentifier{})
// EnumeratedType is the type of Enumerated
EnumeratedType = reflect.TypeOf(Enumerated(0))
)