Documentation ¶
Index ¶
- func CertMatchesPrivateKey(cert *x509.Certificate, privateKey *rsa.PrivateKey) bool
- func EncodeCertAndKeyToPEM(certDER []byte, certKey *rsa.PrivateKey) ([]byte, []byte, error)
- func GenerateAllCerts(outDir string, privateCACert *x509.Certificate, privateCAKey *rsa.PrivateKey) error
- func GenerateCASignedCert(caCert *x509.Certificate, caKey *rsa.PrivateKey) ([]byte, *rsa.PrivateKey, error)
- func GenerateNewCA() ([]byte, *rsa.PrivateKey, error)
- func GetChiaCACertAndKey() ([]byte, []byte)
- func ParsePemCertificate(certPem []byte) (*x509.Certificate, error)
- func ParsePemKey(keyPem []byte) (*rsa.PrivateKey, error)
- func WriteCertAndKey(certDER []byte, certKey *rsa.PrivateKey, certKeyBase string) ([]byte, []byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CertMatchesPrivateKey ¶ added in v0.11.0
func CertMatchesPrivateKey(cert *x509.Certificate, privateKey *rsa.PrivateKey) bool
CertMatchesPrivateKey tests to make the sure cert and private key match
func EncodeCertAndKeyToPEM ¶ added in v0.12.0
EncodeCertAndKeyToPEM encodes the cert and key to PEM
func GenerateAllCerts ¶
func GenerateAllCerts(outDir string, privateCACert *x509.Certificate, privateCAKey *rsa.PrivateKey) error
GenerateAllCerts generates the full set of required certs for chia blockchain If privateCACert and privateCAKey are both nil, a new private CA will be generated
func GenerateCASignedCert ¶
func GenerateCASignedCert(caCert *x509.Certificate, caKey *rsa.PrivateKey) ([]byte, *rsa.PrivateKey, error)
GenerateCASignedCert generates a new key/cert signed by the given CA
func GenerateNewCA ¶
func GenerateNewCA() ([]byte, *rsa.PrivateKey, error)
GenerateNewCA generates a new CA
func GetChiaCACertAndKey ¶ added in v0.12.0
GetChiaCACertAndKey returns the cert and key bytes for chia_ca.crt and chia_ca.key
func ParsePemCertificate ¶
func ParsePemCertificate(certPem []byte) (*x509.Certificate, error)
ParsePemCertificate parses a certificate
func ParsePemKey ¶
func ParsePemKey(keyPem []byte) (*rsa.PrivateKey, error)
ParsePemKey parses a key
func WriteCertAndKey ¶
func WriteCertAndKey(certDER []byte, certKey *rsa.PrivateKey, certKeyBase string) ([]byte, []byte, error)
WriteCertAndKey Returns the written cert bytes, key bytes, and error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.