package asn1tools
import "github.com/jcmturner/gokrb5/v8/asn1tools"
Package asn1tools provides tools for managing ASN1 marshaled data.
Index ¶
- func AddASNAppTag(b []byte, tag int) []byte
- func GetLengthFromASN(b []byte) int
- func GetNumberBytesInLengthHeader(b []byte) int
- func MarshalLengthBytes(l int) []byte
Functions ¶
func AddASNAppTag ¶
AddASNAppTag adds an ASN1 encoding application tag value to the raw bytes provided.
func GetLengthFromASN ¶
GetLengthFromASN returns the length of a slice of ASN1 encoded bytes from the ASN1 length header it contains.
func GetNumberBytesInLengthHeader ¶
GetNumberBytesInLengthHeader returns the number of bytes in the ASn1 header that indicate the length.
func MarshalLengthBytes ¶
MarshalLengthBytes returns the ASN1 encoded bytes for the length 'l'
There are two forms: short (for lengths between 0 and 127), and long definite (for lengths between 0 and 2^1008 -1).
Short form: One octet. Bit 8 has value "0" and bits 7-1 give the length.
Long form: Two to 127 octets. Bit 8 of first octet has value "1" and bits 7-1 give the number of additional length octets. Second and following octets give the length, base 256, most significant digit first.
Source Files ¶
- Version
- v8.4.1
- Published
- Jul 25, 2020
- Platform
- js/wasm
- Imports
- 1 packages
- Last checked
- 3 hours ago –
Tools for package owners.