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:
Aaron Huslage 2015-05-05 16:53:23 -04:00
parent 031e257f9c
commit bdf01d33c4
1 changed files with 3 additions and 1 deletions

View File

@ -55,7 +55,7 @@ func newCertificate(org string) (*x509.Certificate, error) {
NotBefore: notBefore,
NotAfter: notAfter,
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageKeyAgreement,
BasicConstraintsValid: true,
}, nil
@ -72,6 +72,8 @@ func GenerateCACertificate(certFile, keyFile, org string, bits int) error {
template.IsCA = true
template.KeyUsage |= x509.KeyUsageCertSign
template.KeyUsage |= x509.KeyUsageKeyEncipherment
template.KeyUsage |= x509.KeyUsageKeyAgreement
priv, err := rsa.GenerateKey(rand.Reader, bits)
if err != nil {