Simplify default template.

This commit is contained in:
Mariano Cano 2020-07-07 18:56:05 -07:00
parent abc0a63e32
commit 6eba0e0e0e

View file

@ -1,15 +1,14 @@
package x509util
const (
UserKey = "User"
SubjectKey = "Subject"
SANsKey = "SANs"
)
const DefaultLeafTemplate = `{
"subject": {{ toJson .Subject }},
"sans": [
{{- range $index, $san := initial .SANs }}
{"type": "{{ $san.Type }}", "value": "{{ $san.Value }}"},
{{- end }}
{{- with last .SANs }}
{"type": "{{ .Type }}", "value": "{{ .Value }}"}
{{- end }}
],
"sans": {{ toJson .SANs }},
"keyUsage": ["keyEncipherment", "digitalSignature"],
"extKeyUsage": ["serverAuth", "clientAuth"]
}`