encryptors

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockEncryptor

type MockEncryptor struct {
	Serial string
}

MockEncryptor 模拟字符串加密器

func (*MockEncryptor) Encrypt

func (e *MockEncryptor) Encrypt(ctx context.Context, serial, plaintext string) (ciphertext string, err error)

Encrypt 使用指定证书进行字符串加密

func (*MockEncryptor) SelectCertificate

func (e *MockEncryptor) SelectCertificate(ctx context.Context) (serial string, err error)

SelectCertificate 模拟选择加密用证书

type WechatPayEncryptor

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

WechatPayEncryptor 微信支付字符串加密器

func NewWechatPayEncryptor

func NewWechatPayEncryptor(certProvider core.CertificateGetter) *WechatPayEncryptor

NewWechatPayEncryptor 新建一个 WechatPayEncryptor

func (*WechatPayEncryptor) Encrypt

func (e *WechatPayEncryptor) Encrypt(ctx context.Context, serial, plaintext string) (ciphertext string, err error)

Encrypt 对字符串加密

func (*WechatPayEncryptor) SelectCertificate

func (e *WechatPayEncryptor) SelectCertificate(ctx context.Context) (serial string, err error)

SelectCertificate 选择合适的微信支付平台证书用于加密 根据微信支付平台证书文档说明,应优先使用最新的证书(即启用时间最晚) https://wechatpay-api.gitbook.io/wechatpay-api-v3/jie-kou-wen-dang/ping-tai-zheng-shu#zhu-yi-shi-xiang

Jump to

Keyboard shortcuts

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