Skip to content

Commit 193f221

Browse files
committed
Updated policy example
1 parent 897b61b commit 193f221

File tree

1 file changed

+23
-14
lines changed

1 file changed

+23
-14
lines changed

step-ca/templates.mdx

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Configuring `step-ca` Templates
33
html_title: Configuring open source step-ca Templates
44
description: Learn how to configure step-ca Templates
5-
updated_at: April 02, 2025
5+
updated_at: April 03, 2025
66
---
77

88
People use private CAs for all sorts of things, in many different contexts:
@@ -805,6 +805,7 @@ the following properties:
805805

806806
```json
807807
{
808+
...
808809
"nameConstraints": {
809810
"critical": false,
810811
"permittedDNSDomains": ["doe.com"],
@@ -814,8 +815,9 @@ the following properties:
814815
"permittedEmailAddresses": ["[email protected]"],
815816
"excludedEmailAddresses": ["[email protected]"],
816817
"permittedURIDomains": ["https://doe.com"],
817-
"excludedURIDomains": ["https://doe.org"],
818-
}
818+
"excludedURIDomains": ["https://doe.org"]
819+
}
820+
...
819821
}
820822
```
821823

@@ -824,10 +826,12 @@ write it as a string:
824826

825827
```json
826828
{
829+
...
827830
"nameConstraints": {
828831
"critical": true,
829832
"permittedDNSDomains": "example.com"
830833
}
834+
...
831835
}
832836
```
833837

@@ -861,9 +865,11 @@ also write a custom extension like:
861865

862866
```json
863867
{
868+
...
864869
"extensions": [
865870
{"id": "1.2.3.4", "critical": false, "value": "Y3VzdG9tIGV4dGVuc2lvbiB2YWx1ZQ=="}
866871
]
872+
...
867873
}
868874
```
869875

@@ -879,40 +885,43 @@ We'll do that in the next example.
879885
X.509 Certificate Policies define policy constraints of a certificate.
880886
They help relying parties determine the trustworthiness of a certificate,
881887
and how to use it in practice.
882-
For example, a Certificate Policy might detail how the CA verified the identity of the certificate requestor,
883-
or elaborate on use cases (TLS, email encryption, code signing) that are allowed by the PKI for that certificate.
884888

885-
A Certificate Practice Statement (CPS) is type of policy that references a human-readable document published by a CA
886-
describing its operational practices and security controls.
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 because it depends on the relying party.
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.
887895

888896
Here's [an example of a CPS from Let's Encrypt](https://letsencrypt.org/documents/isrg-cp-cps-v5.7/).
889897

890-
Let's put together a Certificate Policies extension using an X.509 template.
891-
We'll need to construct some ASN.1 for this:
898+
Let's add a policy extension with a CPS to an X.509 template.
899+
We'll need to construct some ASN.1 for this.
892900

893901
```
894902
{
903+
...
895904
"extensions": [
896905
{
897906
"id": "2.5.29.32",
898907
"value": {{
899908
asn1Seq
900909
(asn1Seq
901-
(asn1Enc "oid:1.3.5.7")
910+
(asn1Enc "oid:1.3.6.1.4.1.99999.1.1.1")
902911
(asn1Seq (asn1Seq (asn1Enc "oid:1.3.6.1.5.5.7.2.1") (asn1Enc "ia5:http://example.com/cps")))
903912
)
904913
| toJson
905914
}}
906915
}
907916
]
917+
...
908918
}
909919
```
910920

911-
First, the OID `2.5.29.32` represents the Certificate Policies extension.
921+
First, the public OID `2.5.29.32` represents the Certificate Policies extension.
912922
In the value for this extension, we have two policies.
913-
The first references Policy OID `1.3.5.7`, a custom policy OID that would be defined by the organization.
914-
For the second value, both a Policy OID and a CPS URI `http://example.com/cps` is provided.
915-
The CPS URI contains a document explaining how the CA enforces policy `1.3.6.1.5.5.7.2.1`.
923+
The first references Policy OID `1.3.6.1.4.1.99999.1.1.1`, a custom policy OID that would be defined by our 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`.
916925

917926
#### X.509 OpenVPN certificates
918927

0 commit comments

Comments
 (0)