Documentation ¶
Index ¶
- type CryptoUtil
- func (_aes *CryptoUtil) DecryptAes(src []byte, key []byte) (string, error)
- func (_aes *CryptoUtil) DecryptAesBase64(src string, key []byte) (string, error)
- func (_aes *CryptoUtil) DecryptAesHex(src string, key []byte) (string, error)
- func (_rsa *CryptoUtil) DecryptRSA(priv *rsa.PrivateKey, ciphertext []byte) ([]byte, error)
- func (_rsa *CryptoUtil) DecryptRSABase64Str(priv *rsa.PrivateKey, ciphertext string) (string, error)
- func (_rsa *CryptoUtil) DecryptRSAHexStr(priv *rsa.PrivateKey, ciphertext string) (string, error)
- func (_rsa *CryptoUtil) DecryptRSAStr(priv *rsa.PrivateKey, ciphertext string) (string, error)
- func (_aes *CryptoUtil) EncryptAes(src []byte, key []byte) ([]byte, error)
- func (_aes *CryptoUtil) EncryptAesBase64(src []byte, key []byte) (string, error)
- func (_aes *CryptoUtil) EncryptAesBase64Str(src string, key []byte) (string, error)
- func (_aes *CryptoUtil) EncryptAesHex(src []byte, key []byte) (string, error)
- func (_aes *CryptoUtil) EncryptAesHexStr(src string, key []byte) (string, error)
- func (_aes *CryptoUtil) EncryptAesStr(src string, key []byte) ([]byte, error)
- func (_rsa *CryptoUtil) EncryptRSA(pub *rsa.PublicKey, msg []byte) ([]byte, error)
- func (_rsa *CryptoUtil) EncryptRSABase64(pub *rsa.PublicKey, msg []byte) (string, error)
- func (_rsa *CryptoUtil) EncryptRSABase64Str(pub *rsa.PublicKey, msg string) (string, error)
- func (_rsa *CryptoUtil) EncryptRSAHex(pub *rsa.PublicKey, msg []byte) (string, error)
- func (_rsa *CryptoUtil) EncryptRSAHexStr(pub *rsa.PublicKey, msg string) (string, error)
- func (_rsa *CryptoUtil) EncryptRSAStr(pub *rsa.PublicKey, msg string) ([]byte, error)
- func (_rsa *CryptoUtil) GenerateRSAKey() ([]byte, []byte, error)
- func (_rsa *CryptoUtil) GenerateRSAKeyBase64() (string, string, error)
- func (_rsa *CryptoUtil) GenerateRSAKeyFile(privateKeyFile string, publicKeyFile string) error
- func (_rsa *CryptoUtil) GenerateRSAKeyHex() (string, string, error)
- func (c *CryptoUtil) Md5Hex(bytes []byte) string
- func (c *CryptoUtil) Md5HexStr(str string) string
- func (_rsa *CryptoUtil) ParseRSAPrivateKeyStr(privateKey string) (*rsa.PrivateKey, error)
- func (_rsa *CryptoUtil) ParseRSAPublicKeyStr(publicKey string) (*rsa.PublicKey, error)
- func (c *CryptoUtil) Sha1Hex(bytes []byte) string
- func (c *CryptoUtil) Sha1HexStr(str string) string
- func (c *CryptoUtil) Sha256Hex(bytes []byte) string
- func (c *CryptoUtil) Sha256HexStr(str string) string
- func (c *CryptoUtil) Sha512Hex(bytes []byte) string
- func (c *CryptoUtil) Sha512HexStr(str string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CryptoUtil ¶
type CryptoUtil struct { }
func (*CryptoUtil) DecryptAes ¶
func (_aes *CryptoUtil) DecryptAes(src []byte, key []byte) (string, error)
func (*CryptoUtil) DecryptAesBase64 ¶
func (_aes *CryptoUtil) DecryptAesBase64(src string, key []byte) (string, error)
func (*CryptoUtil) DecryptAesHex ¶
func (_aes *CryptoUtil) DecryptAesHex(src string, key []byte) (string, error)
func (*CryptoUtil) DecryptRSA ¶ added in v0.0.2
func (_rsa *CryptoUtil) DecryptRSA(priv *rsa.PrivateKey, ciphertext []byte) ([]byte, error)
func (*CryptoUtil) DecryptRSABase64Str ¶ added in v0.0.2
func (_rsa *CryptoUtil) DecryptRSABase64Str(priv *rsa.PrivateKey, ciphertext string) (string, error)
func (*CryptoUtil) DecryptRSAHexStr ¶ added in v0.0.2
func (_rsa *CryptoUtil) DecryptRSAHexStr(priv *rsa.PrivateKey, ciphertext string) (string, error)
func (*CryptoUtil) DecryptRSAStr ¶ added in v0.0.2
func (_rsa *CryptoUtil) DecryptRSAStr(priv *rsa.PrivateKey, ciphertext string) (string, error)
func (*CryptoUtil) EncryptAes ¶
func (_aes *CryptoUtil) EncryptAes(src []byte, key []byte) ([]byte, error)
ECB
func (*CryptoUtil) EncryptAesBase64 ¶
func (_aes *CryptoUtil) EncryptAesBase64(src []byte, key []byte) (string, error)
func (*CryptoUtil) EncryptAesBase64Str ¶
func (_aes *CryptoUtil) EncryptAesBase64Str(src string, key []byte) (string, error)
func (*CryptoUtil) EncryptAesHex ¶
func (_aes *CryptoUtil) EncryptAesHex(src []byte, key []byte) (string, error)
func (*CryptoUtil) EncryptAesHexStr ¶
func (_aes *CryptoUtil) EncryptAesHexStr(src string, key []byte) (string, error)
func (*CryptoUtil) EncryptAesStr ¶
func (_aes *CryptoUtil) EncryptAesStr(src string, key []byte) ([]byte, error)
func (*CryptoUtil) EncryptRSA ¶ added in v0.0.2
func (*CryptoUtil) EncryptRSABase64 ¶ added in v0.0.2
func (*CryptoUtil) EncryptRSABase64Str ¶ added in v0.0.2
func (*CryptoUtil) EncryptRSAHex ¶ added in v0.0.2
func (*CryptoUtil) EncryptRSAHexStr ¶ added in v0.0.2
func (*CryptoUtil) EncryptRSAStr ¶ added in v0.0.2
func (*CryptoUtil) GenerateRSAKey ¶ added in v0.0.2
func (_rsa *CryptoUtil) GenerateRSAKey() ([]byte, []byte, error)
func (*CryptoUtil) GenerateRSAKeyBase64 ¶ added in v0.0.2
func (_rsa *CryptoUtil) GenerateRSAKeyBase64() (string, string, error)
func (*CryptoUtil) GenerateRSAKeyFile ¶ added in v0.0.2
func (_rsa *CryptoUtil) GenerateRSAKeyFile(privateKeyFile string, publicKeyFile string) error
func (*CryptoUtil) GenerateRSAKeyHex ¶ added in v0.0.2
func (_rsa *CryptoUtil) GenerateRSAKeyHex() (string, string, error)
func (*CryptoUtil) Md5Hex ¶
func (c *CryptoUtil) Md5Hex(bytes []byte) string
func (*CryptoUtil) Md5HexStr ¶
func (c *CryptoUtil) Md5HexStr(str string) string
func (*CryptoUtil) ParseRSAPrivateKeyStr ¶ added in v0.0.2
func (_rsa *CryptoUtil) ParseRSAPrivateKeyStr(privateKey string) (*rsa.PrivateKey, error)
func (*CryptoUtil) ParseRSAPublicKeyStr ¶ added in v0.0.2
func (_rsa *CryptoUtil) ParseRSAPublicKeyStr(publicKey string) (*rsa.PublicKey, error)
func (*CryptoUtil) Sha1Hex ¶
func (c *CryptoUtil) Sha1Hex(bytes []byte) string
func (*CryptoUtil) Sha1HexStr ¶
func (c *CryptoUtil) Sha1HexStr(str string) string
func (*CryptoUtil) Sha256Hex ¶
func (c *CryptoUtil) Sha256Hex(bytes []byte) string
func (*CryptoUtil) Sha256HexStr ¶
func (c *CryptoUtil) Sha256HexStr(str string) string
func (*CryptoUtil) Sha512Hex ¶
func (c *CryptoUtil) Sha512Hex(bytes []byte) string
func (*CryptoUtil) Sha512HexStr ¶
func (c *CryptoUtil) Sha512HexStr(str string) string
Click to show internal directories.
Click to hide internal directories.