Documentation ¶
Index ¶
- func CreateKeyX509PKCS1(bits int) (pub string, pri string)
- func Decrypt(key *rsa.PrivateKey, src []byte) (data []byte, err error)
- func Encrypt(key *rsa.PublicKey, src []byte) (data []byte, err error)
- func PrivateKeyFromX509PKCS1(pri string) (*rsa.PrivateKey, error)
- func PublicKeyFromX509PKCS1(pub string) (*rsa.PublicKey, error)
- func Sign(key *rsa.PrivateKey, src []byte) (sign []byte, err error)
- func Verify(key *rsa.PublicKey, sign, src []byte) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateKeyX509PKCS1 ¶
CreateKeyX509PKCS1 生成指定长度的公钥和私钥
func PrivateKeyFromX509PKCS1 ¶
func PrivateKeyFromX509PKCS1(pri string) (*rsa.PrivateKey, error)
PrivateKeyFromX509PKCS1 pri解析为 rsa.PrivateKey
func PublicKeyFromX509PKCS1 ¶
PublicKeyFromX509PKCS1 pub rsa.PublicKey
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.