Simplify default template.
This commit is contained in:
parent
abc0a63e32
commit
6eba0e0e0e
1 changed files with 7 additions and 8 deletions
|
@ -1,15 +1,14 @@
|
||||||
package x509util
|
package x509util
|
||||||
|
|
||||||
|
const (
|
||||||
|
UserKey = "User"
|
||||||
|
SubjectKey = "Subject"
|
||||||
|
SANsKey = "SANs"
|
||||||
|
)
|
||||||
|
|
||||||
const DefaultLeafTemplate = `{
|
const DefaultLeafTemplate = `{
|
||||||
"subject": {{ toJson .Subject }},
|
"subject": {{ toJson .Subject }},
|
||||||
"sans": [
|
"sans": {{ toJson .SANs }},
|
||||||
{{- range $index, $san := initial .SANs }}
|
|
||||||
{"type": "{{ $san.Type }}", "value": "{{ $san.Value }}"},
|
|
||||||
{{- end }}
|
|
||||||
{{- with last .SANs }}
|
|
||||||
{"type": "{{ .Type }}", "value": "{{ .Value }}"}
|
|
||||||
{{- end }}
|
|
||||||
],
|
|
||||||
"keyUsage": ["keyEncipherment", "digitalSignature"],
|
"keyUsage": ["keyEncipherment", "digitalSignature"],
|
||||||
"extKeyUsage": ["serverAuth", "clientAuth"]
|
"extKeyUsage": ["serverAuth", "clientAuth"]
|
||||||
}`
|
}`
|
||||||
|
|
Loading…
Reference in a new issue