crypto

package
v0.0.0-...-8b2090c Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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

func DecryptData(password string, data []byte) ([]byte, error)

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

func PemToPublicKey(pemBytes []byte) (*rsa.PublicKey, error)

PemToPublicKey pem back to public key

func PublicKeyToPem

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

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

func VerifyMessage

func VerifyMessage(pubString string, message []byte, signature []byte) bool

VerifyMessage verifies a message, signature pair using a public key as PEM

Types

This section is empty.

Jump to

Keyboard shortcuts

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