libolmpickle

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2025 License: MPL-2.0 Imports: 9 Imported by: 6

Documentation

Index

Constants

View Source
const (
	PickleBoolLength   = 1
	PickleUInt8Length  = 1
	PickleUInt32Length = 4
)

Variables

This section is empty.

Functions

func Pickle added in v0.23.1

func Pickle(key, plaintext []byte) ([]byte, error)

Pickle encrypts the input with the key and the cipher AESSHA256. The result is then encoded in base64.

func PickleAsJSON added in v0.23.1

func PickleAsJSON(object any, pickleVersion byte, key []byte) ([]byte, error)

PickleAsJSON returns an object as a base64 string encrypted using the supplied key. The unencrypted representation of the object is in JSON format.

func Unpickle added in v0.23.1

func Unpickle(key, input []byte) ([]byte, error)

Unpickle decodes the input from base64 and decrypts the decoded input with the key and the cipher AESSHA256.

func UnpickleAsJSON added in v0.23.1

func UnpickleAsJSON(object any, pickled, key []byte, pickleVersion byte) error

UnpickleAsJSON updates the object by a base64 encrypted string using the supplied key. The unencrypted representation has to be in JSON format.

Types

type Decoder added in v0.22.0

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

func NewDecoder added in v0.22.0

func NewDecoder(buf []byte) *Decoder

func (*Decoder) ReadBool added in v0.22.0

func (d *Decoder) ReadBool() (bool, error)

func (*Decoder) ReadBytes added in v0.22.0

func (d *Decoder) ReadBytes(length int) (data []byte, err error)

func (*Decoder) ReadUInt32 added in v0.22.0

func (d *Decoder) ReadUInt32() (uint32, error)

func (*Decoder) ReadUInt8 added in v0.22.0

func (d *Decoder) ReadUInt8() (uint8, error)

type Encoder added in v0.22.0

type Encoder struct {
	bytes.Buffer
}

func NewEncoder added in v0.22.0

func NewEncoder() *Encoder

func (*Encoder) WriteBool added in v0.22.0

func (p *Encoder) WriteBool(value bool)

func (*Encoder) WriteEmptyBytes added in v0.22.0

func (p *Encoder) WriteEmptyBytes(count int)

func (*Encoder) WriteUInt32 added in v0.22.0

func (p *Encoder) WriteUInt32(value uint32)

func (*Encoder) WriteUInt8 added in v0.22.0

func (p *Encoder) WriteUInt8(value uint8)

Jump to

Keyboard shortcuts

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