aboutsummaryrefslogtreecommitdiff
path: root/certificate_data.go
blob: 76f3323fb936bc6e60b189fd86e205696179235c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
}