aes

package
v0.0.0-...-beacba6 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AES = "AES"
)

Variables

This section is empty.

Functions

func AESKeyToPEM

func AESKeyToPEM(key *AESKey) []byte

func NewAESKey

func NewAESKey(key []byte) interfaces.Key

Types

type AES128KeyGenOpts

type AES128KeyGenOpts struct {
	Temporary bool
}

func (*AES128KeyGenOpts) Algorithm

func (opts *AES128KeyGenOpts) Algorithm() string

func (*AES128KeyGenOpts) Ephemeral

func (opts *AES128KeyGenOpts) Ephemeral() bool

type AES256KeyDerivOpts

type AES256KeyDerivOpts struct {
	Temporary bool
	Arg       []byte
}

func (*AES256KeyDerivOpts) Algorithm

func (opts *AES256KeyDerivOpts) Algorithm() string

func (*AES256KeyDerivOpts) Argument

func (opts *AES256KeyDerivOpts) Argument() []byte

func (*AES256KeyDerivOpts) Ephemeral

func (opts *AES256KeyDerivOpts) Ephemeral() bool

type AES256KeyGenOpts

type AES256KeyGenOpts struct {
	Temporary bool
}

func (*AES256KeyGenOpts) Algorithm

func (opts *AES256KeyGenOpts) Algorithm() string

func (*AES256KeyGenOpts) Ephemeral

func (opts *AES256KeyGenOpts) Ephemeral() bool

type AESCBCPKCS7Decrypter

type AESCBCPKCS7Decrypter struct{}

func NewAESCBCPKCS7Decrypter

func NewAESCBCPKCS7Decrypter() *AESCBCPKCS7Decrypter

func (*AESCBCPKCS7Decrypter) Decrypt

func (decrypter *AESCBCPKCS7Decrypter) Decrypt(key interfaces.Key, ciphertext []byte, opts interfaces.DecrypterOpts) ([]byte, error)

Decrypt 此方法的第三个参数 DecrypterOpts 可以是 nil。

type AESCBCPKCS7Encrypter

type AESCBCPKCS7Encrypter struct{}

func NewAESCBCPKCS7Encrypter

func NewAESCBCPKCS7Encrypter() *AESCBCPKCS7Encrypter

func (*AESCBCPKCS7Encrypter) Encrypt

func (encrypter *AESCBCPKCS7Encrypter) Encrypt(key interfaces.Key, plaintext []byte, opts interfaces.EncrypterOpts) ([]byte, error)

Encrypt 此方法的第三个参数 EncrypterOpts 要么是 *AESCBCPKCS7ModeOpts,要么是 AESCBCPKCS7ModeOpts。

type AESCBCPKCS7ModeOpts

type AESCBCPKCS7ModeOpts struct {
	// IV 加密时使用的初始化向量
	IV []byte
}

type AESKey

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

func (*AESKey) Bytes

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

Bytes 返回 AES 密钥自身。

func (*AESKey) Private

func (key *AESKey) Private() bool

func (*AESKey) PublicKey

func (key *AESKey) PublicKey() (interfaces.Key, error)

func (*AESKey) SKI

func (key *AESKey) SKI() []byte

func (*AESKey) Symmetric

func (key *AESKey) Symmetric() bool

type AESKeyDerivOpts

type AESKeyDerivOpts struct {
	Temporary bool
	Arg       []byte
}

func (*AESKeyDerivOpts) Algorithm

func (opts *AESKeyDerivOpts) Algorithm() string

func (*AESKeyDerivOpts) Argument

func (opts *AESKeyDerivOpts) Argument() []byte

func (*AESKeyDerivOpts) Ephemeral

func (opts *AESKeyDerivOpts) Ephemeral() bool

type AESKeyDeriver

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

func NewAESKeyDeriver

func NewAESKeyDeriver(c *config.Config) *AESKeyDeriver

func (*AESKeyDeriver) KeyDeriv

type AESKeyGenerator

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

func NewAESKeyGenerator

func NewAESKeyGenerator(length int) *AESKeyGenerator

func (*AESKeyGenerator) KeyGen

KeyGen 此方法的入参 KeyGenOpts 可以是 nil。

type AESKeyImportOpts

type AESKeyImportOpts struct {
	Temporary bool
}

func (*AESKeyImportOpts) Algorithm

func (opts *AESKeyImportOpts) Algorithm() string

func (*AESKeyImportOpts) Ephemeral

func (opts *AESKeyImportOpts) Ephemeral() bool

type AESKeyImporter

type AESKeyImporter struct{}

func NewAESKeyImporter

func NewAESKeyImporter() *AESKeyImporter

func (*AESKeyImporter) KeyImport

func (importer *AESKeyImporter) KeyImport(raw interface{}, opts interfaces.KeyImportOpts) (interfaces.Key, error)

KeyImport 此方法的第二个参数 KeyImportOpts 可以是 nil。

Jump to

Keyboard shortcuts

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