diff options
author | Gibheer <gibheer@gmail.com> | 2015-03-30 20:44:31 +0200 |
---|---|---|
committer | Gibheer <gibheer@gmail.com> | 2015-03-30 20:44:31 +0200 |
commit | 04899fd3738804b519af07d3537caf0d73a7a3ad (patch) | |
tree | 9f3767a9840320d42256584bfa1e923aa831bf19 | |
parent | 301d931ad76c0754e58cf024b46bebe685faafc5 (diff) |
add extended key usage for certificates
-rw-r--r-- | certificate.go | 6 |
1 files changed, 4 insertions, 2 deletions
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 |