Documentation ¶
Index ¶
- func Base64UrlDecoding(src string) ([]byte, error)
- func Base64UrlEncoding(src string) string
- func DecodeBase64FromString(data string) ([]byte, error)
- func DecodeHex(dst, src []byte) (int, error)
- func DecodeHexFromString(hexStr string) ([]byte, error)
- func EncodeBase64ToString(src string) string
- func EncodeHex(dst, src []byte) int
- func EncodeHexToString(src []byte) string
- func GenECCPemKeyFile(privateKey *ecdsa.PrivateKey, pemKeyPath string) error
- func GenRSAPemKeyFile(privateKey *rsa.PrivateKey, pemKeyPath string) error
- func ParseECCPrivatePemKey(privateKeyFile string) (privateKey *ecdsa.PrivateKey, err error)
- func ParseECCPublicPemKey(publicKeyFile string) (publicKey *ecdsa.PublicKey, err error)
- func ParseRSAPrivatePemKey(privateKeyFile string) (privateKey *rsa.PrivateKey, err error)
- func ParseRSAPublicPemKey(publicKeyFile string) (publicKey *rsa.PublicKey, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64UrlEncoding ¶
用于URL参数传输时的编解码,如果要用在url中,需要使用URLEncoding
func DecodeHexFromString ¶
返回hex编码的字符串hexStr解码的数据,入参字符串需事先被hex编码过
func GenECCPemKeyFile ¶
func GenECCPemKeyFile(privateKey *ecdsa.PrivateKey, pemKeyPath string) error
序列化rsa公私钥并保存为pem文件 @param privateKey *ecdsa.PrivateKey 使用ecdsa中的GenerateKey方法生成私钥值 @param pemKeyPath string pem公私钥文件的保存路径
func GenRSAPemKeyFile ¶
func GenRSAPemKeyFile(privateKey *rsa.PrivateKey, pemKeyPath string) error
序列化rsa公私钥并保存为pem文件 @param privateKey *rsa.PrivateKey 使用rsa中的GenerateKey方法生成私钥值 @param pemKeyPath string pem公私钥文件的保存路径
func ParseECCPrivatePemKey ¶
func ParseECCPrivatePemKey(privateKeyFile string) (privateKey *ecdsa.PrivateKey, err error)
获取私钥文件
func ParseECCPublicPemKey ¶
解析公钥文件
func ParseRSAPrivatePemKey ¶
func ParseRSAPrivatePemKey(privateKeyFile string) (privateKey *rsa.PrivateKey, err error)
解析RSA私钥文件
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.