Documentation ¶
Index ¶
- type Encryptor
- type RSAEncryptor
- func (e *RSAEncryptor) Decrypt(encrypted string) (decrypted string, err error)
- func (e *RSAEncryptor) Encrypt(text string) (encrypted string, err error)
- func (e *RSAEncryptor) GenerateKeyPair() (err error)
- func (e *RSAEncryptor) PrivateKey() (privateKey string)
- func (e *RSAEncryptor) PublicKey() (publicKey string, err error)
- func (e *RSAEncryptor) SetPrivateKey(privateKey string) (err error)
- func (e *RSAEncryptor) SetPublicKey(publicKey string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RSAEncryptor ¶
type RSAEncryptor struct {
// contains filtered or unexported fields
}
func NewRSAEncryptor ¶
func NewRSAEncryptor() *RSAEncryptor
func (*RSAEncryptor) Decrypt ¶
func (e *RSAEncryptor) Decrypt(encrypted string) (decrypted string, err error)
Decrypt decrypts data with given private key.
func (*RSAEncryptor) Encrypt ¶
func (e *RSAEncryptor) Encrypt(text string) (encrypted string, err error)
Encrypt encrypts data with given public key.
func (*RSAEncryptor) GenerateKeyPair ¶
func (e *RSAEncryptor) GenerateKeyPair() (err error)
GenerateKeyPair generates a new key pair.
func (*RSAEncryptor) PrivateKey ¶
func (e *RSAEncryptor) PrivateKey() (privateKey string)
PrivateKey gets the Private Key value.
func (*RSAEncryptor) PublicKey ¶
func (e *RSAEncryptor) PublicKey() (publicKey string, err error)
PublicKey gets the Public Key value.
func (*RSAEncryptor) SetPrivateKey ¶
func (e *RSAEncryptor) SetPrivateKey(privateKey string) (err error)
SetPrivateKey sets the Private Key value.
func (*RSAEncryptor) SetPublicKey ¶
func (e *RSAEncryptor) SetPublicKey(publicKey string) (err error)
SetPublicKey sets the Public Key value.
Click to show internal directories.
Click to hide internal directories.