mirror of https://github.com/docker/docs.git
Generate more generic certificates that can have other uses.
Added `Digital Signature, Key Encipherment, Key Agreement` Key Usage values. Signed-off-by: Aaron Huslage <aaron@docker.com>
This commit is contained in:
parent
031e257f9c
commit
bdf01d33c4
|
@ -55,7 +55,7 @@ func newCertificate(org string) (*x509.Certificate, error) {
|
||||||
NotBefore: notBefore,
|
NotBefore: notBefore,
|
||||||
NotAfter: notAfter,
|
NotAfter: notAfter,
|
||||||
|
|
||||||
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
|
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageKeyAgreement,
|
||||||
BasicConstraintsValid: true,
|
BasicConstraintsValid: true,
|
||||||
}, nil
|
}, nil
|
||||||
|
|
||||||
|
@ -72,6 +72,8 @@ func GenerateCACertificate(certFile, keyFile, org string, bits int) error {
|
||||||
|
|
||||||
template.IsCA = true
|
template.IsCA = true
|
||||||
template.KeyUsage |= x509.KeyUsageCertSign
|
template.KeyUsage |= x509.KeyUsageCertSign
|
||||||
|
template.KeyUsage |= x509.KeyUsageKeyEncipherment
|
||||||
|
template.KeyUsage |= x509.KeyUsageKeyAgreement
|
||||||
|
|
||||||
priv, err := rsa.GenerateKey(rand.Reader, bits)
|
priv, err := rsa.GenerateKey(rand.Reader, bits)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue