Documentation ¶
Index ¶
- func Decrypt(sk *rsa.PrivateKey, in []byte) ([]byte, error)
- func Encrypt(pk *rsa.PublicKey, in, label []byte) ([]byte, error)
- func ExportRSAPrivateKeyAsPEMString(privkey *rsa.PrivateKey) string
- func ExportRSAPublicKeyAsPEMString(pubkey *rsa.PublicKey) (string, error)
- func ParseRSAPrivateKeyFromPEMString(privPEM string) (*rsa.PrivateKey, error)
- func ParseRSAPublicKeyFromPEMString(pubPEM string) (*rsa.PublicKey, error)
- type KeyPair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶
func Decrypt(sk *rsa.PrivateKey, in []byte) ([]byte, error)
Decrypt decrypts input with private key.
func ExportRSAPrivateKeyAsPEMString ¶
func ExportRSAPrivateKeyAsPEMString(privkey *rsa.PrivateKey) string
ExportRSAPrivateKeyAsPEMString converts private key to string.
func ExportRSAPublicKeyAsPEMString ¶
ExportRSAPublicKeyAsPEMString converts public key to string.
func ParseRSAPrivateKeyFromPEMString ¶
func ParseRSAPrivateKeyFromPEMString(privPEM string) (*rsa.PrivateKey, error)
ParseRSAPrivateKeyFromPEMString converts string private key to private key.
Types ¶
type KeyPair ¶
type KeyPair struct { Private *rsa.PrivateKey Public *rsa.PublicKey }
KeyPair is RSA key pair.
func GenerateKeyPair ¶
GenerateKeyPair returns private & public keys.
Click to show internal directories.
Click to hide internal directories.