Documentation ¶
Index ¶
- func CertAsBytes(cert *x509.Certificate) (b []byte, err error)
- func CertMatchesParams(key *rsa.PrivateKey, cert *x509.Certificate, params *CertParams) bool
- func NewCA(cn string) (*rsa.PrivateKey, *x509.Certificate, error)
- func NewCert(p *CertParams) (*rsa.PrivateKey, *x509.Certificate, error)
- func NewPrivateKey() (*rsa.PrivateKey, error)
- func ParseCert(b []byte) (*x509.Certificate, error)
- func ParsePrivateKey(b []byte) (*rsa.PrivateKey, error)
- func PrivateKeyAsBytes(key *rsa.PrivateKey) (b []byte, err error)
- func PublicKeyAsBytes(key *rsa.PublicKey) (b []byte, err error)
- func SSHPublicKeyAsString(key *rsa.PublicKey) (s string, err error)
- type CertParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CertAsBytes ¶
func CertAsBytes(cert *x509.Certificate) (b []byte, err error)
func CertMatchesParams ¶
func CertMatchesParams(key *rsa.PrivateKey, cert *x509.Certificate, params *CertParams) bool
CertMatchesParams returns true if the given key and cert match the CertParams struct.
func NewCA ¶
func NewCA(cn string) (*rsa.PrivateKey, *x509.Certificate, error)
NewCA returns a new rsa.PrivateKey and x509.Certificate for a CA corresponding to the given CommonName.
func NewCert ¶
func NewCert(p *CertParams) (*rsa.PrivateKey, *x509.Certificate, error)
NewCert returns a new rsa.PrivateKey and x509.Certificate for a certificate corresponding to the given CertParams struct.
func NewPrivateKey ¶
func NewPrivateKey() (*rsa.PrivateKey, error)
NewPrivateKey returns a new 2048-bit rsa.PrivateKey
func ParsePrivateKey ¶
func ParsePrivateKey(b []byte) (*rsa.PrivateKey, error)
func PrivateKeyAsBytes ¶
func PrivateKeyAsBytes(key *rsa.PrivateKey) (b []byte, err error)
Types ¶
type CertParams ¶
type CertParams struct { Subject pkix.Name DNSNames []string IPAddresses []net.IP ExtKeyUsage []x509.ExtKeyUsage SigningKey *rsa.PrivateKey // leave nil for self-signed SigningCert *x509.Certificate // leave nil for self-signed }
CertParams defines the parameters which can be passed into NewCert.
Click to show internal directories.
Click to hide internal directories.