encryptor

package
v2.1.14 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidBlockSize block size 不合法.
	ErrInvalidBlockSize = errors.New("invalid block size")
	// ErrInvalidPKCS7Data PKCS7 数据不合法.
	ErrInvalidPKCS7Data = errors.New("invalid PKCS7 data")
	// ErrInvalidPKCS7Padding padding 不合法.
	ErrInvalidPKCS7Padding = errors.New("invalid PKCS7 padding")
)

Functions

func Decrypt

func Decrypt(aesKey, ciphertext string) ([]byte, error)

Decrypt decrypts base64 AES-CBC ciphertext.

func Encrypt

func Encrypt(aesKey string, plaintext []byte) (string, error)

Encrypt encrypts plaintext with AES-CBC and returns base64 ciphertext.

func Sign

func Sign(token string, timestamp int64, nonce string, body []byte) string

Sign calculates the aispeech request signature.

Types

This section is empty.

Jump to

Keyboard shortcuts

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