Documentation
¶
Index ¶
- Constants
- Variables
- func ParsePrivateKey(data []byte) (crypto.PrivateKey, error)
- type CertType
- type KeyPair
- func GenerateCA(keyType KeyType, subject pkix.Name) (*KeyPair, error)
- func NewCert(parent x509.Certificate, parentKey crypto.Signer, commonName string, ...) (KeyPair, error)
- func NewSelfSignedCert(commonName string, certType CertType, keyType KeyType, hosts ...string) (KeyPair, error)
- func ToKeyPair(key crypto.PrivateKey, cert []byte) (*KeyPair, error)
- type KeyType
Constants ¶
Variables ¶
View Source
var DefaultKeyType = RSAKeyType
View Source
var (
DefaultValidityPeriod = 10 * 365 * 24 * time.Hour
)
Functions ¶
func ParsePrivateKey ¶ added in v1.8.1
func ParsePrivateKey(data []byte) (crypto.PrivateKey, error)
ParsePrivateKey parses an ASN.1 DER-encoded private key. This is basically what tls.X509KeyPair does internally.
Types ¶
type KeyPair ¶
func GenerateCA ¶ added in v1.8.1
func NewCert ¶ added in v1.8.1
func NewCert( parent x509.Certificate, parentKey crypto.Signer, commonName string, certType CertType, keyType KeyType, hosts ...string, ) (KeyPair, error)
NewCert generates certificate that is signed by the CA (parent)
func NewSelfSignedCert ¶
type KeyType ¶ added in v1.8.1
var RSAKeyType KeyType = func() (crypto.Signer, error) { return util_rsa.GenerateKey(util_rsa.DefaultKeySize) }
Click to show internal directories.
Click to hide internal directories.