Documentation ¶
Index ¶
- Constants
- func AESCBCDecrypt(key []byte, decodeBytes []byte) (string, error)
- func AESCBCEncrypt(key []byte, encodeStr string) ([]byte, error)
- func AESCBCEncryptZeroIV(plaintext []byte) ([]byte, error)
- func HmacSha256(secret string, message string) (string, error)
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func RSAVerifySignWithSha256(publicKey []byte, origData []byte, signData string) error
- func Sha256(origData []byte) []byte
- type Key
- type KeyStore
Constants ¶
View Source
const (
PublicKey = `` /* 1597-byte string literal not displayed */
)
Variables ¶
This section is empty.
Functions ¶
func AESCBCDecrypt ¶
AESCBCDecrypt from base64 to decrypted string
func AESCBCEncryptZeroIV ¶
func PKCS5Padding ¶
func PKCS5UnPadding ¶
func RSAVerifySignWithSha256 ¶
Types ¶
type Key ¶
type Key struct { Id string `json:"id"` //密钥id KeyExp int64 `json:"key_exp"` //ignore,unix timestamp,密钥过期时间 KeyEffective int64 `json:"key_effective"` //ignore,unix timestamp,密钥生效日期 KeyString string `json:"key_string"` //密钥base64编码 Version uint `json:"version"` //密钥版本号(从0开始) KeyType string `json:"key_type"` //ignore,密钥种类 KeyStatus int `json:"key_status"` //ignore,密钥状态, 0为可用 KeyDigest string `json:"key_digest"` //密钥digest(SHA256),客户端可以校验密钥完整性 }
type KeyStore ¶
type KeyStore struct { CurrentKeyVersion uint `json:"current_key_version"` //最新密钥版本号 Service string `json:"service"` //服务识别码 GrantUsage string `json:"grant_usage"` //ignore,密钥权限,E为加密,D为解密 Keys []Key `json:"keys"` //加解密密钥,可能是多个 }
func (*KeyStore) GetCurrentKey ¶
func (*KeyStore) GetFirstKey ¶
Click to show internal directories.
Click to hide internal directories.