Documentation
¶
Index ¶
- Constants
- func AESEncrypt(raw []byte, key []byte, iv []byte) (string, error)
- func AesDecryptAndReturnBytes(raw string, key []byte, iv []byte) ([]byte, error)
- func GetAesKeySize() int
- func GetSm4KeySize() int
- func RSAEncrypt(raw []byte, pk string) (string, error)
- func SetAesKeySize(size int)
- func SetSm4KeySize(size int)
- func Sm4DecryptAndReturnBytes(ciphertext string, key []byte, iv []byte) ([]byte, error)
- func Sm4Encrypt(plaintext []byte, key []byte, iv []byte) (string, error)
- type RSACrypto
- func (r *RSACrypto) Decrypt(raw string) (string, error)
- func (r *RSACrypto) DecryptAndReturnBytes(raw string) ([]byte, error)
- func (r *RSACrypto) Encrypt(raw string) (string, error)
- func (r *RSACrypto) Private() string
- func (r *RSACrypto) Public() string
- func (r *RSACrypto) TryDecrypt(raw string) string
- func (r *RSACrypto) TryEncrypt(raw string) string
Constants ¶
View Source
const ( KEY_SIZE = 512 ERR_NO_INIT = "rsa crypto not initialized" )
Variables ¶
This section is empty.
Functions ¶
func GetAesKeySize ¶
func GetAesKeySize() int
func GetSm4KeySize ¶
func GetSm4KeySize() int
func SetAesKeySize ¶
func SetAesKeySize(size int)
func SetSm4KeySize ¶
func SetSm4KeySize(size int)
Types ¶
type RSACrypto ¶
type RSACrypto struct {
// contains filtered or unexported fields
}
func NewRSACrypto ¶
func NewRSACryptoFromKey ¶
func (*RSACrypto) DecryptAndReturnBytes ¶
func (*RSACrypto) TryDecrypt ¶
func (*RSACrypto) TryEncrypt ¶
Click to show internal directories.
Click to hide internal directories.