Documentation ¶
Index ¶
- func GeneratePrivateKey() (pk *ecdsa.PrivateKey, err error)
- func GenerateRootCert(privateKey *ecdsa.PrivateKey) (cert *x509.Certificate, err error)
- func GenerateTLSCert(id hotstuff.ID, hosts []string, parent *x509.Certificate, ...) (cert *x509.Certificate, err error)
- func ReadCertFile(certFile string) (cert *x509.Certificate, err error)
- func ReadPrivateKeyFile(keyFile string) (key *ecdsa.PrivateKey, err error)
- func ReadPublicKeyFile(keyFile string) (key *ecdsa.PublicKey, err error)
- func WriteCertFile(cert *x509.Certificate, file string) (err error)
- func WritePrivateKeyFile(key *ecdsa.PrivateKey, filePath string) (err error)
- func WritePublicKeyFile(key *ecdsa.PublicKey, filePath string) (err error)
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 ¶
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.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.