From 04899fd3738804b519af07d3537caf0d73a7a3ad Mon Sep 17 00:00:00 2001 From: Gibheer Date: Mon, 30 Mar 2015 20:44:31 +0200 Subject: add extended key usage for certificates --- certificate.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'certificate.go') diff --git a/certificate.go b/certificate.go index ac66fbc..4ac62b8 100644 --- a/certificate.go +++ b/certificate.go @@ -42,8 +42,9 @@ type ( IsCA bool // how many sub ca are allowed between this ca and the end/final certificate // if it is -1, then no limit will be set - CALength int - KeyUsage x509.KeyUsage + CALength int + KeyUsage x509.KeyUsage // for what can the certificate be used + KeyExtendedUsage []x509.ExtKeyUsage // extended usage for the certificate } ) @@ -110,6 +111,7 @@ func (c *CertificateRequest) ToCertificate(private_key PrivateKey, template.NotBefore = cert_opts.NotBefore template.NotAfter = cert_opts.NotAfter template.KeyUsage = cert_opts.KeyUsage + template.ExtKeyUsage = cert_opts.KeyExtendedUsage template.IsCA = cert_opts.IsCA if cert_opts.IsCA { template.BasicConstraintsValid = true -- cgit v1.2.3-70-g09d2