v3.2.1 Latest Latest

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

Go to latest
Published: Jul 21, 2020 License: MIT Imports: 6 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type AES

type AES struct {
	// contains filtered or unexported fields

AES is an Codec that encrypts the data and uses a sub marshaller to actually serialize the data

func NewAES

func NewAES(subMarshaller codec.MarshalUnmarshaler, key []byte) (*AES, error)

NewAES creates a new AES encryption marshaller. It takes a sub marshaller to actually serialize the data and a 16/32 bytes private key to encrypt all data using AES in GCM block mode.

func (*AES) Marshal

func (c *AES) Marshal(v interface{}) ([]byte, error)

Marshal marshals the given data object to an encrypted byte array

func (*AES) Name

func (c *AES) Name() string

Name returns a compound of the inner marshaller prefixed by 'aes-'

func (*AES) Unmarshal

func (c *AES) Unmarshal(data []byte, v interface{}) error

Unmarshal unmarshals the given encrypted byte array to the given type

Jump to

Keyboard shortcuts

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