Documentation ¶
Index ¶
- func FetchRemoteCertificate(address string) (*x509.Certificate, error)
- func FindOrGenerate(certFile, keyFile string, certType CertificateType) error
- func Fingerprint(cert *x509.Certificate) string
- func FingerprintFromStr(c string) (string, error)
- func Read(path string) (*x509.Certificate, error)
- func Save(c *x509.Certificate, fileName string) error
- type Cert
- type CertificateType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchRemoteCertificate ¶
func FetchRemoteCertificate(address string) (*x509.Certificate, error)
FetchRemoteCertificate connects to a server and returns its tls certificate
func FindOrGenerate ¶
func FindOrGenerate(certFile, keyFile string, certType CertificateType) error
FindOrGenerate generates new key and cert if they don't exist
func Fingerprint ¶
func Fingerprint(cert *x509.Certificate) string
Fingerprint returns the fingerprint of a certificate
func FingerprintFromStr ¶
FingerprintFromStr returns a fingerprint of a raw certificate parameter
Types ¶
type Cert ¶
type Cert struct {
KeyPair tls.Certificate
}
Cert captures TLS certificate information about public/private keypair and an optional CA certificate
func (*Cert) Fingerprint ¶
Fingerprint returns the fingerprint of the public key.
func (*Cert) PrivateKey ¶
PrivateKey is a convenience to encode the underlying private key.
type CertificateType ¶
type CertificateType int
CertificateType represents a client or server certificate
const ( ServerCertificateType CertificateType = 0 ClientCertificateType CertificateType = 1 )
Types of certificate that can be generated
Click to show internal directories.
Click to hide internal directories.