Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RelativeOID ¶
type RelativeOID struct {
// contains filtered or unexported fields
}
RelativeOID represents an ASN.1 Relative OID. This is similar to the Go stdlib's x509.OID and ans1.OID, except that it does not perform the first-two-components packing optimization that non-relative OIDs use. It also limits each OID component to fit in a uint32, a restriction which does not exist in the ASN.1 spec but seems nonetheless reasonable.
func FromBytes ¶
func FromBytes(in []byte) (*RelativeOID, error)
FromBytes parses a Relative OID from its DER representation, not including the leading tag and length bytes. It rejects any input which is empty, has incorrectly-encoded components, or has components too large to fit in an int32.
func FromString ¶
func FromString(in string) (*RelativeOID, error)
FromString parses a Relative OID from its dotted-decimal string representation. It rejects any input which is empty, has empty components (two dots in a row), has non-canonical components (leading zeros or plus signs), has negative components, or has components too large to fit in an int32.
func (*RelativeOID) Bytes ¶
func (r *RelativeOID) Bytes() []byte
Bytes returns the DER-encoded byte representation of the relative OID, not including the tag and length bytes. It is the inverse of FromBytes.
func (*RelativeOID) String ¶
func (r *RelativeOID) String() string
String returns the dotted-decimal string representation of the relative OID. It is the inverse of FromString.