aboutsummaryrefslogtreecommitdiff
path: root/crypto.go
diff options
context:
space:
mode:
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
}