example.tpl 656 B

123456789101112131415161718192021
  1. {
  2. "subject": {{ toJson .Insecure.CR.Subject }},
  3. "sans": {{ toJson .SANs }},
  4. {{- if .Insecure.CR.EmailAddresses }}
  5. "emailAddresses": {{ toJson .Insecure.CR.EmailAddresses }},
  6. {{- end }}
  7. {{- if .Token }}
  8. "uris": "{{ .Token.iss }}#{{ .Token.sub }}",
  9. {{- end }}
  10. {{- if typeIs "*rsa.PublicKey" .Insecure.CR.PublicKey }}
  11. {{- if lt .Insecure.CR.PublicKey.Size 384 }}
  12. {{ fail "Key length must be at least 3072 bits" }}
  13. {{- end }}
  14. {{- end }}
  15. {{- if typeIs "*rsa.PublicKey" .Insecure.CR.PublicKey }}
  16. "keyUsage": ["keyEncipherment", "digitalSignature"],
  17. {{- else }}
  18. "keyUsage": ["digitalSignature"],
  19. {{- end }}
  20. "extKeyUsage": ["serverAuth", "clientAuth"]
  21. }