Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadASN1ObjectIdentifier ¶
func ReadASN1ObjectIdentifier(s *cryptobyte.String, out *encoding_asn1.ObjectIdentifier) bool
ReadASN1ObjectIdentifier decodes an ASN.1 OBJECT IDENTIFIER into out and advances. It reports whether the read was successful.
Example ¶
package main
import (
encoding_asn1 "encoding/asn1"
"fmt"
"golang.org/x/crypto/cryptobyte"
"github.com/AlexanderYastrebov/asn1oid64"
)
func main() {
encoded, err := encoding_asn1.Marshal(encoding_asn1.ObjectIdentifier([]int{2, 5, 2, 9223372036854775807}))
if err != nil {
panic(err)
}
in := cryptobyte.String(encoded)
var out encoding_asn1.ObjectIdentifier
ok := asn1oid64.ReadASN1ObjectIdentifier(&in, &out)
fmt.Printf("%s %t", out, ok)
}
Output: 2.5.2.9223372036854775807 true
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.