crypto

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratePrivateKey

func GeneratePrivateKey() (pk *ecdsa.PrivateKey, err error)

GeneratePrivateKey returns a new public/private key pair based on ECDSA.

func GenerateRootCert

func GenerateRootCert(privateKey *ecdsa.PrivateKey) (cert *x509.Certificate, err error)

GenerateRootCert generates a self-signed TLS certificate to act as a CA.

func GenerateTLSCert

func GenerateTLSCert(id hotstuff.ID, hosts []string, parent *x509.Certificate, signeeKey *ecdsa.PublicKey, signerKey *ecdsa.PrivateKey) (cert *x509.Certificate, err error)

GenerateTLSCert generates a TLS certificate for the server that is valid for the given hosts.

func ReadCertFile

func ReadCertFile(certFile string) (cert *x509.Certificate, err error)

ReadCertFile read an x509 certificate from a file.

func ReadPrivateKeyFile

func ReadPrivateKeyFile(keyFile string) (key *ecdsa.PrivateKey, err error)

ReadPrivateKeyFile reads a private key from the specified file.

func ReadPublicKeyFile

func ReadPublicKeyFile(keyFile string) (key *ecdsa.PublicKey, err error)

ReadPublicKeyFile reads a public key from the specified file.

func WriteCertFile

func WriteCertFile(cert *x509.Certificate, file string) (err error)

WriteCertFile writes an x509 certificate to a file.

func WritePrivateKeyFile

func WritePrivateKeyFile(key *ecdsa.PrivateKey, filePath string) (err error)

WritePrivateKeyFile writes a private key to the specified file.

func WritePublicKeyFile

func WritePublicKeyFile(key *ecdsa.PublicKey, filePath string) (err error)

WritePublicKeyFile writes a public key to the specified file.

Types

This section is empty.

Directories

Path Synopsis
Package ecdsa provides a crypto implementation for HotStuff using Go's 'crypto/ecdsa' package.
Package ecdsa provides a crypto implementation for HotStuff using Go's 'crypto/ecdsa' package.

Jump to

Keyboard shortcuts

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