Documentation
¶
Index ¶
- Constants
- func AESKeyToPEM(key *AESKey) []byte
- func NewAESKey(key []byte) csp.Key
- type AES128KeyGenOpts
- type AES256KeyDerivOpts
- type AES256KeyGenOpts
- type AESCBCPKCS7Decrypter
- type AESCBCPKCS7Encrypter
- type AESCBCPKCS7ModeOpts
- type AESKey
- type AESKeyDerivOpts
- type AESKeyDeriver
- type AESKeyGenerator
- type AESKeyImportOpts
- type AESKeyImporter
Constants ¶
View Source
const (
AES = "AES"
)
Variables ¶
This section is empty.
Functions ¶
func AESKeyToPEM ¶
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 ¶
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 csp.Key, ciphertext []byte, opts csp.DecrypterOpts) ([]byte, error)
Decrypt 此方法的第三个参数 DecrypterOpts 可以是 nil。
type AESCBCPKCS7Encrypter ¶
type AESCBCPKCS7Encrypter struct{}
func NewAESCBCPKCS7Encrypter ¶
func NewAESCBCPKCS7Encrypter() *AESCBCPKCS7Encrypter
func (*AESCBCPKCS7Encrypter) Encrypt ¶
func (encrypter *AESCBCPKCS7Encrypter) Encrypt(key csp.Key, plaintext []byte, opts csp.EncrypterOpts) ([]byte, error)
Encrypt 此方法的第三个参数 EncrypterOpts 要么是 *AESCBCPKCS7ModeOpts,要么是 AESCBCPKCS7ModeOpts。
type AESCBCPKCS7ModeOpts ¶
type AESCBCPKCS7ModeOpts struct { // IV 加密时使用的初始化向量 IV []byte }
type AESKeyDerivOpts ¶
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 ¶
func (kd *AESKeyDeriver) KeyDeriv(key csp.Key, opts csp.KeyDerivOpts) (csp.Key, error)
type AESKeyGenerator ¶
type AESKeyGenerator struct {
// contains filtered or unexported fields
}
func NewAESKeyGenerator ¶
func NewAESKeyGenerator(length int) *AESKeyGenerator
func (*AESKeyGenerator) KeyGen ¶
func (kg *AESKeyGenerator) KeyGen(opts csp.KeyGenOpts) (csp.Key, error)
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 csp.KeyImportOpts) (csp.Key, error)
KeyImport 此方法的第二个参数 KeyImportOpts 可以是 nil。
Click to show internal directories.
Click to hide internal directories.