Documentation ¶
Index ¶
- func GeneratePrivateKey(bits int) ([]byte, error)
- func GeneratePrivateKeyFile(bits int, filepath string) error
- func GeneratePrivateKeyString(bits int) (string, error)
- func GeneratePublicKey(privateKey []byte) ([]byte, error)
- func GeneratePublicKeyFile(privateKey []byte, filepath string) error
- func GeneratePublicKeyString(privateKey string) (string, error)
- func PEMDecode(filepath string) (*pem.Block, error)
- func PEMEncode(filepath string, stream []byte, isPrivate bool) error
- type RSA
- func (r *RSA) Decrypt(cipherbytes []byte) (plainbytes []byte, err error)
- func (r *RSA) Encrypt(plainbytes []byte) (cipherbytes []byte, err error)
- func (r *RSA) GetPublickKey() string
- func (r *RSA) Sign(message []byte) (signature []byte, err error)
- func (r *RSA) Verify(message, signature []byte) (ok bool, err error)
- type RSAEncryptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GeneratePrivateKey ¶
func GeneratePrivateKeyFile ¶
func GeneratePublicKey ¶
func GeneratePublicKeyFile ¶
func GeneratePublicKeyString ¶
Types ¶
type RSA ¶
type RSA struct {
// contains filtered or unexported fields
}
func (*RSA) GetPublickKey ¶ added in v1.0.3
type RSAEncryptor ¶ added in v1.0.3
type RSAEncryptor struct {
// contains filtered or unexported fields
}
func NewEncryptor ¶ added in v1.0.3
func NewEncryptor(publicKey string) (*RSAEncryptor, error)
Click to show internal directories.
Click to hide internal directories.