encrypter

package
v5.0.0-beta4 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

Types

type Config

type Config struct {
	Key []byte
	IV  []byte
}

type Encrypter

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

func New

func New(config Config) (*Encrypter, error)

func (*Encrypter) Decrypt

func (e *Encrypter) Decrypt(encrypted []byte) ([]byte, error)

func (*Encrypter) Encrypt

func (e *Encrypter) Encrypt(data []byte) ([]byte, error)

func (*Encrypter) GetEncryptionKey

func (e *Encrypter) GetEncryptionKey() string

GetEncryptionKey returns hex of the key, which is used for certificates encryption.

func (*Encrypter) GetInitialVector

func (e *Encrypter) GetInitialVector() string

GetInitialVector returns hex of the initial vector, which is used in certificate encryption.

type Interface

type Interface interface {
	Encrypt([]byte) ([]byte, error)
	Decrypt([]byte) ([]byte, error)
	GetEncryptionKey() string
	GetInitialVector() string
}

Jump to

Keyboard shortcuts

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