gocer

module
v0.0.0-...-3233107 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2019 License: MIT

README

Simple Go ASN1 Canonical Encoding Rules (CER) encoding

  • int <-> INTEGER
  • float64 <-> REAL
  • bool <-> BOOLEAN
  • struct <-> SEQUENCE
  • slice <-> SEQUENCEOF
  • string <-> UTF8String

Usage

import (
	"github.com/zaryatech/gocer/pkg/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)

Authors

  • Stas Merzlyakov - Initial work - info

Directories

Path Synopsis
cmd
pkg
asn1
* * * * * * * * *
* * * * * * * * *

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL