Documentation ¶
Index ¶
- func CreateEncryptedPK(password string) (pkPem []byte, encryptedPK []byte, pubBytes []byte, err error)
- func DecryptData(password string, data []byte) ([]byte, error)
- func PemToPrivateKey(pemPk []byte) (*rsa.PrivateKey, error)
- func PemToPublicKey(pemBytes []byte) (*rsa.PublicKey, error)
- func PublicKeyToPem(pub *rsa.PublicKey) []byte
- func SignMessage(pk *rsa.PrivateKey, message []byte) ([]byte, error)
- func VerifyMessage(pubString string, message []byte, signature []byte) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEncryptedPK ¶
func CreateEncryptedPK(password string) (pkPem []byte, encryptedPK []byte, pubBytes []byte, err error)
CreateEncryptedPK creates and then turns to bytes all the necessary key information the CLI needs
func DecryptData ¶
DecryptData decrypts two-way encrypted piece of data, mirrors encryptData
func PemToPrivateKey ¶
func PemToPrivateKey(pemPk []byte) (*rsa.PrivateKey, error)
PemToPrivateKey converts a private key PEM to an rsa private key
func PemToPublicKey ¶
PemToPublicKey pem back to public key
func PublicKeyToPem ¶
PublicKeyToPem public key to pem bytes
func SignMessage ¶
func SignMessage(pk *rsa.PrivateKey, message []byte) ([]byte, error)
SignMessage outputs the signate of a message as signed by the pk
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.