Documentation ¶
Index ¶
- func DecodePrivKeyPEM(pk []byte) (*rsa.PrivateKey, error)
- func DecodePubKeyPEM(pk []byte) (*rsa.PublicKey, error)
- func DecryptMessage(cyphertxt []byte, priv *rsa.PrivateKey) ([]byte, error)
- func DecryptMessageWithPEMKey(cyphertxt []byte, priv []byte) ([]byte, error)
- func EncodePrivKeyPEM(priv *rsa.PrivateKey) []byte
- func EncodePubKeyPEM(pub *rsa.PublicKey) []byte
- func EncryptMessage(plaintxt []byte, pub *rsa.PublicKey) ([]byte, error)
- func EncryptMessageWithPEMKey(plaintxt []byte, pub []byte) ([]byte, error)
- func GenerateRSAKeyPair(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)
- func GetFingerprint(pub *rsa.PublicKey) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodePrivKeyPEM ¶
func DecodePrivKeyPEM(pk []byte) (*rsa.PrivateKey, error)
DecodePrivKeyPEM decodes a PEM encoded public key to an *rsa.PublicKey
func DecodePubKeyPEM ¶
DecodePubKeyPEM decodes a PEM encoded public key to an *rsa.PublicKey
func DecryptMessage ¶
func DecryptMessage(cyphertxt []byte, priv *rsa.PrivateKey) ([]byte, error)
DecryptMessage decrypts an encrypted message with a private key
func DecryptMessageWithPEMKey ¶
DecryptMessageWithPEMKey decrypts an encrypted message with a PEM private key
func EncodePrivKeyPEM ¶
func EncodePrivKeyPEM(priv *rsa.PrivateKey) []byte
EncodePrivKeyPEM encodes an *rsa.PrivateKey onto a PEM block
func EncodePubKeyPEM ¶
EncodePubKeyPEM encodes an *rsa.PublicKey onto a PEM block
func EncryptMessage ¶
EncryptMessage encrypts a plaintext message with a public key
func EncryptMessageWithPEMKey ¶
EncryptMessageWithPEMKey encrypts a plaintext message with a PEM encoded public key
func GenerateRSAKeyPair ¶
GenerateRSAKeyPair generates an RSA key-pair and returns it separately
func GetFingerprint ¶
GetFingerprint returns the fingerprint of a public key
Types ¶
This section is empty.