aes

package
v3.2.1 Latest Latest
Warning

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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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