aboutsummaryrefslogtreecommitdiff
path: root/crypto.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-03-06 03:10:23 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-03-06 03:10:23 +0100
commit054c88f817983d7b5daacf78bb2fe8c9505b72f1 (patch)
treef43aeb7ef21003276345819c44cdda4c3804fd12 /crypto.go
parent829de1aa2a398b748e773d7ed3e70612ddd43c4a (diff)
Refactor Bundle and NewDesire
Diffstat (limited to 'crypto.go')
-rw-r--r--crypto.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/crypto.go b/crypto.go
index 220becd..97a9f26 100644
--- a/crypto.go
+++ b/crypto.go
@@ -6,7 +6,6 @@ import (
"crypto/elliptic"
"crypto/rand"
"crypto/rsa"
- "crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/base64"
@@ -82,14 +81,14 @@ func NewKey(size int) (crypto.PrivateKey, error) {
}
}
-func NewCSR(cert tls.Certificate, altnames []string) (string, error) {
+func NewCSR(key crypto.PrivateKey, altnames []string) (string, error) {
tmpl := x509.CertificateRequest{
Subject: pkix.Name{CommonName: altnames[0]},
}
if len(altnames) > 1 {
tmpl.DNSNames = altnames
}
- der, err := x509.CreateCertificateRequest(rand.Reader, &tmpl, cert.PrivateKey)
+ der, err := x509.CreateCertificateRequest(rand.Reader, &tmpl, key)
if err != nil {
return "", err
}