diff --git a/x509util/templates.go b/x509util/templates.go new file mode 100644 index 00000000..a7f2b225 --- /dev/null +++ b/x509util/templates.go @@ -0,0 +1,15 @@ +package x509util + +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 }} + ], + "keyUsage": ["keyEncipherment", "digitalSignature"], + "extKeyUsage": ["serverAuth", "clientAuth"] +}`