Documentation
¶
Index ¶
- type KeyPair
- func (kp *KeyPair) Decrypt(src string, usePrivate bool) ([]byte, error)
- func (kp *KeyPair) DecryptPrivate(src string) ([]byte, error)
- func (kp *KeyPair) DecryptPublic(src string) ([]byte, error)
- func (kp *KeyPair) Encrypt(src []byte, usePublic bool) (string, error)
- func (kp *KeyPair) EncryptPrivate(src []byte) (string, error)
- func (kp *KeyPair) EncryptPublic(src []byte) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyPair ¶
type KeyPair struct {
// contains filtered or unexported fields
}
KeyPair RSA 密钥对
func GenerateKeyPair ¶
GenerateKeyPair 生成 RSA 密钥对
func NewKeyPair ¶
NewKeyPair 从 PEM 格式的密钥数据创建 KeyPair
func (*KeyPair) DecryptPrivate ¶
DecryptPrivate 使用私钥解密数据
func (*KeyPair) DecryptPublic ¶
DecryptPublic 使用公钥解密数据
func (*KeyPair) EncryptPrivate ¶
EncryptPrivate 使用私钥加密数据
Click to show internal directories.
Click to hide internal directories.