Standard library / crypto/x509
crypto/x509.OIDFromInts()
Builds an object identifier from numeric arcs, including arcs beyond ASN.1 int limits. Expected stdout: '1.2.840.113549\n'.
Formal Syntax & Structure
go syntaxgo
func OIDFromInts(oid []uint64) (OID, error)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| oid | []uint64 | Object identifier arcs or dotted decimal text. |
Return Value
(OID, error)
Result as described above; check any returned error before use.
Working Example
Example Snippetgo
package main
import ( "crypto/x509" "fmt")
func main() { v := must(x509.OIDFromInts([]uint64{1, 2, 840, 113549})); fmt.Println(v.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) }}