Golang encoding/asn1.Marshal function example

package encoding/asn1

Marshal returns the ASN.1 encoding of the given input value

Golang encoding/asn1.Marshal function usage example

 pks := publicKeyStructure{
  Algorithm: publicKeyAlgorithm{
 Algorithm: rsaAlgorithm,
 Parameters: "booooyo",
  },
  SubjectPublicKey: asn1.BitString{subjectPublicKey, len(subjectPublicKey)*8},
 }
  
 marshalpks := asn1.Marshal(pks)

Reference :

http://golang.org/pkg/encoding/asn1/#Marshal

Advertisement