diff options
Diffstat (limited to 'certificate_data.go')
-rw-r--r-- | certificate_data.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/certificate_data.go b/certificate_data.go new file mode 100644 index 0000000..76f3323 --- /dev/null +++ b/certificate_data.go @@ -0,0 +1,28 @@ +package main + +import ( + "crypto/x509" + "crypto/x509/pkix" + "net" +) + +type ( + certificateData struct { + Subject pkix.Name + + DnsNames []string + EmailAddresses []string + IpAddresses []net.IP + } +) + +func (c *certificateData) GenerateCSR() *x509.CertificateRequest { + csr := &x509.CertificateRequest{} + + csr.Subject = c.Subject + csr.DNSNames = c.DnsNames + csr.IPAddresses = c.IpAddresses + csr.EmailAddresses = c.EmailAddresses + + return csr +} |