cipher

package
v0.2.18 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cipher

type Cipher interface {
	// Encrypt 使用证书对数据进行原地加密,密文会直接体现在入参 in 中,并返回加密所使用的证书序列号
	Encrypt(ctx context.Context, in interface{}) (string, error)

	// Decrypt 使用私钥对数据进行原地解密,明文会直接体现在入参 in 中,无返回
	Decrypt(ctx context.Context, in interface{}) error
}

Cipher 使用证书对数据中进行原地加密/使用私钥对数据进行原地解密的功能

type Decryptor

type Decryptor interface {
	// Decrypt 对字符串解密
	Decrypt(ctx context.Context, ciphertext string) (plaintext string, err error)
}

Decryptor 字符串解密器

type Encryptor

type Encryptor interface {
	// SelectCertificate 选择合适的微信支付平台证书用于加密
	SelectCertificate(ctx context.Context) (serial string, err error)

	// Encrypt 对字符串加密
	Encrypt(ctx context.Context, serial, plaintext string) (ciphertext string, err error)
}

Encryptor 字符串加密器

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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