Documentation ¶
Index ¶
- Constants
- func AesDecrypt(cryted string) (string, error)
- func AesEncrypt(orig string) (string, error)
- func Base58Decode(b string) ([]byte, error)
- func Base58Encode(b []byte) string
- func Ddbase64sign(key string) (bt []byte, err error)
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func PKCS7UnPadding(plantText []byte) []byte
- type Crypto
- func (c *Crypto) DecryptMsg(signature, timeStamp, nonce, secretStr string) (string, error)
- func (c *Crypto) EncryptMsg(replyMsg, timeStamp, nonce string) (string, string, error)
- func (c *Crypto) GenerateSignature(token, timeStamp, nonce, secretStr string) string
- func (c *Crypto) RandomString(n int, alphabets ...byte) string
- func (c *Crypto) VerifySignature(token, timeStamp, nonce, secretStr, sigture string) bool
- type Test
Constants ¶
View Source
const (
AES_ENCODE_KEY_LENGTH = 43
)
Variables ¶
This section is empty.
Functions ¶
func AesDecrypt ¶
func AesEncrypt ¶
func Base58Decode ¶
Decode decodes a modified base58 string to a byte slice.
func Base58Encode ¶
Encode encodes a byte slice to a modified base58 string.
func PKCS7Padding ¶
func PKCS7UnPadding ¶
Types ¶
type Crypto ¶
type Crypto struct { Token string AesKey string SuiteKey string // contains filtered or unexported fields }
var DefaultDingtalkCrypto *Crypto
func (*Crypto) DecryptMsg ¶
signature: 签名字符串 timeStamp: 时间戳 nonce: 随机字符串 secretStr: 密文 返回: 解密后的明文
func (*Crypto) EncryptMsg ¶
replyMsg: 明文字符串 timeStamp: 时间戳 nonce: 随机字符串 返回: 密文,签名字符串
func (*Crypto) GenerateSignature ¶
数据签名
func (*Crypto) VerifySignature ¶
校验数据签名
Click to show internal directories.
Click to hide internal directories.