keys

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2023 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

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

func DecodePubKeyPEM(pk []byte) (*rsa.PublicKey, error)

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

func DecryptMessageWithPEMKey(cyphertxt []byte, priv []byte) ([]byte, error)

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

func EncodePubKeyPEM(pub *rsa.PublicKey) []byte

EncodePubKeyPEM encodes an *rsa.PublicKey onto a PEM block

func EncryptMessage

func EncryptMessage(plaintxt []byte, pub *rsa.PublicKey) ([]byte, error)

EncryptMessage encrypts a plaintext message with a public key

func EncryptMessageWithPEMKey

func EncryptMessageWithPEMKey(plaintxt []byte, pub []byte) ([]byte, error)

EncryptMessageWithPEMKey encrypts a plaintext message with a PEM encoded public key

func GenerateRSAKeyPair

func GenerateRSAKeyPair(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)

GenerateRSAKeyPair generates an RSA key-pair and returns it separately

func GetFingerprint

func GetFingerprint(pub *rsa.PublicKey) string

GetFingerprint returns the fingerprint of a public key

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL