You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -186,7 +186,7 @@ X.509 templates can be used in two places:
186
186
187
187
Here's what the default X.509 [leaf certificate template](https://github.com/smallstep/crypto/blob/162770cad29063385cb768b0191814e4c6a94e45/x509util/templates.go#L98) looks like:
188
188
189
-
```json
189
+
```go
190
190
{
191
191
"subject": {{ toJson .Subject }},
192
192
"sans": {{ toJson .SANs }},
@@ -319,15 +319,15 @@ before being (optionally) PEM-encoded with Base64.
319
319
320
320
Use these functions to populate custom certificate OID `extensions`:
`step-ca` also supports SSH certificate templates.
425
425
Here is `step-ca`'s default [SSH certificate template](https://github.com/smallstep/crypto/blob/162770cad29063385cb768b0191814e4c6a94e45/sshutil/templates.go#L144):
426
426
427
-
```json
427
+
```go
428
428
{
429
429
"type": {{ toJson .Type }},
430
430
"keyId": {{ toJson .KeyID }},
@@ -454,7 +454,7 @@ Here are the most relevant parameters available in SSH certificate template:
The value of the extension is the Base64 encoding of the
877
+
actual ASN.1 bytes that go into that extension.
878
+
879
+
For a more human-readable template,
880
+
you can also use [ASN.1 functions](#asn1-values) in the extension `value` field.
881
+
We'll do that in the next example.
882
+
883
+
#### Deep dive: Certificate Policies
884
+
885
+
X.509 Certificate Policies define policy constraints of a certificate.
886
+
They help relying parties determine the trustworthiness of a certificate,
887
+
and how to use it in practice.
888
+
889
+
For example, in the Web PKI, the Policy OID `2.23.140.1.2.1` is used to distinguish a certificate that meets the [CA/Browser Forum Baseline Requirements](https://cabforum.org/working-groups/server/baseline-requirements/requirements/) for Domain Validation.
890
+
891
+
In an internal PKI, a large organization might use a Certificate Policy to detail to a relying party how the CA verified the identity of the certificate requestor, or to approve a certificate for specific applications.
892
+
But, this sort of use case is very niche.
893
+
894
+
A Certificate Practices Statement (CPS) is type of Certificate Policy that references a document describing a CA's operational practices and security controls.
895
+
896
+
Here's [an example of a CPS from Let's Encrypt](https://letsencrypt.org/documents/isrg-cp-cps-v5.7/).
897
+
898
+
Let's add a policy extension with a CPS to an X.509 template.
The crux here is that the value of the extension is the Base64 encoding of the
871
-
actual bytes that go into that extension, so if you are encoding a structure
872
-
in your extension using the ASN.1 encoding, you will have to put the Base64
873
-
version of the encoded bytes.
921
+
First, the public OID `2.5.29.32` represents the Certificate Policies extension.
922
+
In the value for this extension, we have two policies.
923
+
The first references Policy OID `1.3.6.1.4.1.99999.1.1.1`, a custom policy OID defined by our example organization.
924
+
The second policy contains both the well-defined OID `1.3.6.1.5.5.7.2.1`[representing a CPS pointer](https://www.rfc-editor.org/rfc/rfc5280.html#section-4.2.1.4), and the CPS pointer `http://example.com/cps`.
874
925
875
926
#### X.509 OpenVPN certificates
876
927
@@ -880,7 +931,7 @@ key usages not available in the default templates.
880
931
881
932
This is a template you can use in a provisioner signing OpenVPN client certificates:
0 commit comments