Documentation ¶
Index ¶
- Constants
- func MarshalPKCS8PrivateKey(key *rsa.PrivateKey) []byte
- func NewRSAFile(pubKeyFileName, priKeyFileName string, keyLength int) error
- func NewRSAString(keyLength int) (string, string, error)
- func ReadRSAKeyPair(pubKeyFilename, priKeyFilename string) ([]byte, []byte, error)
- func WriteRSAKeyPair(publicKeyWriter, privateKeyWriter io.Writer, keyLength int) error
- type GoRSA
Constants ¶
View Source
const ( // RSAAlgorithmSign RSA签名算法 RSAAlgorithmSign = crypto.SHA256 )
Variables ¶
This section is empty.
Functions ¶
func MarshalPKCS8PrivateKey ¶
func MarshalPKCS8PrivateKey(key *rsa.PrivateKey) []byte
MarshalPKCS8PrivateKey 私钥解析
func NewRSAFile ¶
NewRSAFile 生成密钥对文件 pubKeyFileName: 公钥文件名 priKeyFileName: 私钥文件名 keyLength: 密钥长度
func NewRSAString ¶
NewRSAString 生成密钥对字符串 keyLength 密钥的长度
func ReadRSAKeyPair ¶
ReadRSAKeyPair 读取RSA密钥对 pubKeyFilename: 公钥文件名称 priKeyFilename: 私钥文件名
Types ¶
type GoRSA ¶
type GoRSA struct { PublicKey *rsa.PublicKey PrivateKey *rsa.PrivateKey }
GoRSA RSA加密解密
func (*GoRSA) PrivateDecrypt ¶
PrivateDecrypt 私钥解密
func (*GoRSA) PublicEncrypt ¶
PublicEncrypt 公钥加密
Click to show internal directories.
Click to hide internal directories.