aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-06-01 10:23:30 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-06-01 10:23:30 +0200
commitfde9147075fc39ca5849e50b95b7879c4c8d2c93 (patch)
treeaab61195c5a2172ac59276f4ccde24e90dd43689
parent41292fb7074b6c31eb04b4a4beb39b7d7da5b560 (diff)
Add mailAddress OID for future use
-rw-r--r--crypto.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto.go b/crypto.go
index f2ce1d1..917149d 100644
--- a/crypto.go
+++ b/crypto.go
@@ -8,6 +8,7 @@ import (
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
+ "encoding/asn1"
"encoding/base64"
"encoding/pem"
"errors"
@@ -95,6 +96,8 @@ func NewKey(size int) (crypto.PrivateKey, error) {
}
}
+var oidMailAddress = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 9, 1}
+
func NewCSR(key crypto.PrivateKey, altnames, emails []string) (string, error) {
tmpl := x509.CertificateRequest{
Subject: pkix.Name{CommonName: altnames[0]},