| 51 | ) |
| 52 | |
| 53 | func CertConfigToModule(prefix string, m *session.SessionModule, defaults CertConfig) { |
| 54 | m.AddParam(session.NewIntParameter(prefix+".certificate.bits", strconv.Itoa(defaults.Bits), |
| 55 | "Number of bits of the RSA private key of the generated HTTPS certificate.")) |
| 56 | m.AddParam(session.NewStringParameter(prefix+".certificate.country", defaults.Country, ".*", |
| 57 | "Country field of the generated HTTPS certificate.")) |
| 58 | m.AddParam(session.NewStringParameter(prefix+".certificate.locality", defaults.Locality, ".*", |
| 59 | "Locality field of the generated HTTPS certificate.")) |
| 60 | m.AddParam(session.NewStringParameter(prefix+".certificate.organization", defaults.Organization, ".*", |
| 61 | "Organization field of the generated HTTPS certificate.")) |
| 62 | m.AddParam(session.NewStringParameter(prefix+".certificate.organizationalunit", defaults.OrganizationalUnit, ".*", |
| 63 | "Organizational Unit field of the generated HTTPS certificate.")) |
| 64 | m.AddParam(session.NewStringParameter(prefix+".certificate.commonname", defaults.CommonName, ".*", |
| 65 | "Common Name field of the generated HTTPS certificate.")) |
| 66 | } |
| 67 | |
| 68 | func CertConfigFromModule(prefix string, m session.SessionModule) (cfg CertConfig, err error) { |
| 69 | if err, cfg.Bits = m.IntParam(prefix + ".certificate.bits"); err != nil { |