Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTruncated = errors.New("asn1: truncated data") ErrUnexpectedTag = errors.New("asn1: unexpected tag") ErrIntOverflow = errors.New("asn1: integer overflows int32") ErrInvalidLen = errors.New("asn1: invalid length encoding") )
Sentinel errors — no fmt.Errorf allocation on hot path
Functions ¶
func EncodeIdentity ¶
EncodeIdentity serializes the pair (int32, []byte)
Types ¶
type Result ¶
type Result struct {
IsInt bool
Int32 int32 // valid when IsInt == true
Str string // valid when IsInt == false
Data []byte // zero-copy reference into input
}
Result holds the decoded payload. IsInt distinguishes the two variants. Data is a zero-copy sub-slice of the input — do not modify input while using it.
func DecodeIdentity ¶
DecodeIdentity parses a DER SEQUENCE containing either [INTEGER, OCTET STRING] or [UTF8String, OCTET STRING].
Click to show internal directories.
Click to hide internal directories.