Documentation ¶
Index ¶
- func GenerateSerialNumber() (*big.Int, error)
- func New(opts ...CertOption) ([]byte, []byte, error)
- func NewCA(opts ...CertOption) ([]byte, []byte, error)
- func NewClientFromCA(caPrivKeyPEM, caCertPEM io.Reader, opts ...CertOption) ([]byte, []byte, error)
- func NewServerFromCA(caPrivKeyPEM, caCertPEM io.Reader, opts ...CertOption) ([]byte, []byte, error)
- func ReadCertAndKey(caCertPEM, caPrivKeyPEM io.Reader) (*x509.Certificate, interface{}, error)
- func SaveCertAndKey(prefix string, caCertPEM, caPrivKeyPEM []byte) error
- type CertOption
- func IsCA() CertOption
- func IsClient() CertOption
- func IsServer() CertOption
- func IsValidFor(d time.Duration) CertOption
- func WithCommonName(name string) CertOption
- func WithKey(key interface{}) CertOption
- func WithNewECDSAKey() CertOption
- func WithNewRSAKey() CertOption
- func WithParent(cert *x509.Certificate, key interface{}) CertOption
- type CertOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSerialNumber ¶
GenerateSerialNumber creates a new serial number for a x509 certificate.
func New ¶
func New(opts ...CertOption) ([]byte, []byte, error)
New generates a PEM encoded x509 cert and private key.
func NewClientFromCA ¶
func NewServerFromCA ¶
func ReadCertAndKey ¶
func ReadCertAndKey(caCertPEM, caPrivKeyPEM io.Reader) (*x509.Certificate, interface{}, error)
func SaveCertAndKey ¶
Types ¶
type CertOption ¶
type CertOption func(*CertOptions) error
func IsCA ¶
func IsCA() CertOption
func IsClient ¶
func IsClient() CertOption
func IsServer ¶
func IsServer() CertOption
func IsValidFor ¶
func IsValidFor(d time.Duration) CertOption
func WithCommonName ¶
func WithCommonName(name string) CertOption
func WithKey ¶
func WithKey(key interface{}) CertOption
func WithNewECDSAKey ¶
func WithNewECDSAKey() CertOption
func WithNewRSAKey ¶
func WithNewRSAKey() CertOption
func WithParent ¶
func WithParent(cert *x509.Certificate, key interface{}) CertOption
type CertOptions ¶
type CertOptions struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.