- int <-> INTEGER
- float64 <-> REAL
- bool <-> BOOLEAN
- struct <-> SEQUENCE
- slice <-> SEQUENCEOF
- string <-> UTF8String
- nil <-> NULL // for slice
import (
"github.com/StasMerzlyakov/gocer/asn1"
)
type TestStuct struct {
Id int
E float64
}
// encode to bytes.Buffer
value := []TestStruct{TestStruct{}, TestStruct{1, math.Pi}}
var bbuffer bytes.Buffer
asn1.Encode(value, &bbuffer)
// decode from bytes.Buffer
var evalue []TestStruct
asn1.Decode(&evalue, &bbuffer)
- Stas Merzlyakov - Initial work - info
- ASN1 specification ASN1 Spec