Documentation ¶
Index ¶
- func CRLPEM(b []byte) []byte
- func CSRPEM(b []byte) []byte
- func CertPEM(b []byte) []byte
- func HashSubjectKeyID(key *rsa.PublicKey) ([]byte, error)
- func LoadCRLFromPEM(path string) (*pkix.CertificateList, error)
- func LoadCSRFromPEM(path string) (*x509.CertificateRequest, error)
- func LoadCertFromPEM(path string) ([]byte, error)
- func LoadPrivateKeyFromPEM(path string) (*rsa.PrivateKey, error)
- func LoadPublicKeyFromPEM(path string) (interface{}, error)
- func NewCA(key *rsa.PrivateKey, cn string) ([]byte, error)
- func NewCRL(key *rsa.PrivateKey, cert []byte, list []pkix.RevokedCertificate) ([]byte, error)
- func NewCSR(key *rsa.PrivateKey, cn string) ([]byte, error)
- func NewClientCert(authkey *rsa.PrivateKey, hostkey *rsa.PrivateKey, cn string, ca []byte, ...) ([]byte, error)
- func NewClientTLSFromFiles(servercert, clientcert, clientkey string) (credentials.TransportCredentials, error)
- func NewKey(bits int) (*rsa.PrivateKey, error)
- func NewSerial() (*big.Int, error)
- func NewTemplate() *x509.Certificate
- func PrivateKeyPEM(key *rsa.PrivateKey) []byte
- func PublicKeyPEM(key *rsa.PublicKey) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashSubjectKeyID ¶
HashSubjectKeyID returns the hash for a public key.
func LoadCRLFromPEM ¶
func LoadCRLFromPEM(path string) (*pkix.CertificateList, error)
LoadCRLFromPEM returns an x509 CertificateList.
func LoadCSRFromPEM ¶
func LoadCSRFromPEM(path string) (*x509.CertificateRequest, error)
LoadCSRFromPEM returns an x509 CertificateRequest.
func LoadCertFromPEM ¶
LoadCertFromPEM returns the raw bytes of a certificate.
func LoadPrivateKeyFromPEM ¶
func LoadPrivateKeyFromPEM(path string) (*rsa.PrivateKey, error)
LoadPrivateKeyFromPEM returns a parsed private key structure.
func LoadPublicKeyFromPEM ¶
LoadPublicKeyFromPEM returns a parsed private key structure.
func NewCA ¶
func NewCA(key *rsa.PrivateKey, cn string) ([]byte, error)
NewCA creates a new certificate authority which further client certificates can be generated with.
func NewCRL ¶
func NewCRL(key *rsa.PrivateKey, cert []byte, list []pkix.RevokedCertificate) ([]byte, error)
NewCRL creates a new certificate revocation list.
func NewCSR ¶
func NewCSR(key *rsa.PrivateKey, cn string) ([]byte, error)
NewCSR creates a new certificate signing request.
func NewClientCert ¶
func NewClientCert(authkey *rsa.PrivateKey, hostkey *rsa.PrivateKey, cn string, ca []byte, csr *x509.CertificateRequest) ([]byte, error)
NewClientCert makes certificates for client authentication.
func NewClientTLSFromFiles ¶ added in v0.3.0
func NewClientTLSFromFiles(servercert, clientcert, clientkey string) (credentials.TransportCredentials, error)
NewClientTLSFromFiles is an improved version of gRPC's NewClientTLSFromFile which also loads the root certificate for the certificate authority so that connections actually work with verification.
func NewKey ¶
func NewKey(bits int) (*rsa.PrivateKey, error)
NewKey creates a new RSA key for certificate generation and signing.
func NewTemplate ¶
func NewTemplate() *x509.Certificate
NewTemplate for server and client certificates.
func PrivateKeyPEM ¶
func PrivateKeyPEM(key *rsa.PrivateKey) []byte
PrivateKeyPEM converts a private key to PEM format.
Types ¶
This section is empty.