Standard library / crypto/x509/pkix

crypto/x509/pkix.AlgorithmIdentifier

ASN.1 algorithm OID and optional raw parameters; not a guarantee of implementation support. Expected stdout: '1.3.101.112\n'.

Formal Syntax & Structure

go syntaxgo
type AlgorithmIdentifier struct {  Algorithm  asn1.ObjectIdentifier  Parameters asn1.RawValue `asn1:"optional"`}

Working Example

Example Snippetgo
package main
import (  "crypto/x509/pkix"  "encoding/asn1"  "fmt")
func main() {  v := pkix.AlgorithmIdentifier{Algorithm: asn1.ObjectIdentifier{1, 3, 101, 112}}  fmt.Println(v.Algorithm.String())}
func must[T any](v T, e error) T {  if e != nil {    panic(e)  }  return v}func check(e error) {  if e != nil {    panic(e)  }}
Go Reference