aes

package
v2.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AES_GCM_IV_LENGTH  = 12
	AES_GCM_TAG_LENGTH = 16
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AESKey

type AESKey struct {
	Key []byte
}

func (*AESKey) Bytes

func (aesKey *AESKey) Bytes() ([]byte, error)

func (*AESKey) Decrypt

func (aesKey *AESKey) Decrypt(crypted []byte) ([]byte, error)

The input ciphertext can be ASN1 encoded, or of the form:

nonce + ciphertext + tag (can be nil)

func (*AESKey) DecryptWithOpts

func (aesKey *AESKey) DecryptWithOpts(crypted []byte, opts *crypto.EncOpts) ([]byte, error)

func (*AESKey) Encrypt

func (aesKey *AESKey) Encrypt(plain []byte) ([]byte, error)

The ciphertext returned by Encrypt() and EncryptWithOpts can be ASN1 encoded, or of the form:

nonce + ciphertext + tag (can be nil)

func (*AESKey) EncryptWithOpts

func (aesKey *AESKey) EncryptWithOpts(plain []byte, opts *crypto.EncOpts) ([]byte, error)

func (*AESKey) String

func (aesKey *AESKey) String() (string, error)

func (*AESKey) Type

func (aesKey *AESKey) Type() crypto.KeyType

Jump to

Keyboard shortcuts

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