Documentation ¶
Index ¶
- func DecryptWithPrivateKey(privateKey *rsa.PrivateKey, in []byte) (out []byte, err error)
- func EncryptWithPublicKey(publicKey *rsa.PublicKey, in []byte) (out []byte, err error)
- type RSA
- func (object *RSA) Decrypt(in []byte) (out []byte, err error)
- func (object *RSA) Encrypt(in []byte) (out []byte, err error)
- func (object *RSA) MakeKey(keySize int) (err error)
- func (object *RSA) PrivateToPem() (str string, err error)
- func (object *RSA) PublicToPem() (str string, err error)
- func (object *RSA) Sign(hash crypto.Hash, src []byte) (sign []byte, err error)
- func (object *RSA) Verify(hash crypto.Hash, src, sign []byte) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptWithPrivateKey ¶
func DecryptWithPrivateKey(privateKey *rsa.PrivateKey, in []byte) (out []byte, err error)
DecryptWithPrivateKey 私钥解密
Types ¶
type RSA ¶
type RSA struct {
PrivateKey *rsa.PrivateKey
}
RSA
func (*RSA) PrivateToPem ¶
PrivateToPem 私钥转换为PEM格式
func (*RSA) PublicToPem ¶
PublicToPem 公钥转换为PEM格式
Click to show internal directories.
Click to hide internal directories.