Documentation ¶
Index ¶
- func BinAbsPath() string
- func FileCreateAll(file string) (*os.File, error)
- func FileIsExist(path string) bool
- func FileUserHome() string
- func JsonParseStr(jsonData string, obj interface{}) error
- func JsonToStr(obj interface{}) (string, error)
- func RSADecrypt(privateKey *rsa.PrivateKey, ciphertext []byte) ([]byte, error)
- func RSAEncrypt(publicKey *rsa.PublicKey, data []byte) ([]byte, error)
- func RSAGenerateKeys(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)
- func RSALoadPrivatePEMKey(fileName string) (*rsa.PrivateKey, error)
- func RSALoadPublicPEMKey(fileName string) (*rsa.PublicKey, error)
- func RSASavePrivatePEMKey(filename string, key *rsa.PrivateKey) error
- func RSASavePublicPEMKey(filename string, pubkey *rsa.PublicKey) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BinAbsPath ¶
func BinAbsPath() string
func FileCreateAll ¶
FileCreateAll 创建文件,若目录不存在则创建,若文件存在则覆盖
func JsonParseStr ¶
func RSADecrypt ¶
func RSADecrypt(privateKey *rsa.PrivateKey, ciphertext []byte) ([]byte, error)
RSADecrypt 使用私钥解密数据
func RSAEncrypt ¶
RSAEncrypt 使用公钥加密数据
func RSAGenerateKeys ¶
RSAGenerateKeys 生成RSA公私钥对,并返回私钥和公钥
func RSALoadPrivatePEMKey ¶
func RSALoadPrivatePEMKey(fileName string) (*rsa.PrivateKey, error)
RSALoadPrivatePEMKey 从PEM文件中加载私钥
func RSALoadPublicPEMKey ¶
RSALoadPublicPEMKey 从PEM文件中加载公钥
func RSASavePrivatePEMKey ¶
func RSASavePrivatePEMKey(filename string, key *rsa.PrivateKey) error
RSASavePrivatePEMKey 将私钥保存到文件中
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.