asn1

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEarlyEOF          = asn1.SyntaxError{Msg: "early EOF"}
	ErrConstructed       = asn1.SyntaxError{Msg: "constructed value"}
	ErrPrimitive         = asn1.SyntaxError{Msg: "primitive value"}
	ErrUnsupportedLength = asn1.StructuralError{Msg: "length method not supported"}
)

Functions

func ConvertToDER

func ConvertToDER(ber []byte) ([]byte, error)

Types

type ConstructedValue

type ConstructedValue struct {
	// contains filtered or unexported fields
}

func DecodeConstructed

func DecodeConstructed(r ValueReader) (*ConstructedValue, error)

func (*ConstructedValue) Encode

func (v *ConstructedValue) Encode(w ValueWriter) error

func (*ConstructedValue) EncodedLen

func (v *ConstructedValue) EncodedLen() int

type LimitedValueReader

type LimitedValueReader struct {
	io.LimitedReader
	S io.ByteScanner
}

func (*LimitedValueReader) ReadByte

func (l *LimitedValueReader) ReadByte() (c byte, err error)

func (*LimitedValueReader) UnreadByte

func (l *LimitedValueReader) UnreadByte() (err error)

type PrimitiveValue

type PrimitiveValue struct {
	// contains filtered or unexported fields
}

func DecodePrimitive

func DecodePrimitive(r ValueReader) (*PrimitiveValue, error)

func (*PrimitiveValue) Encode

func (v *PrimitiveValue) Encode(w ValueWriter) error

func (*PrimitiveValue) EncodedLen

func (v *PrimitiveValue) EncodedLen() int

type Value

type Value interface {
	Encode(ValueWriter) error
	EncodedLen() int
}

func Decode

func Decode(r ValueReader) (Value, error)

type ValueReader

type ValueReader interface {
	io.Reader
	io.ByteScanner
}

func LimitValueReader

func LimitValueReader(r ValueReader, n int64) ValueReader

type ValueWriter

type ValueWriter interface {
	io.Writer
	io.ByteWriter
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL