Skip to content

Commit 33f284e

Browse files
committed
More edits and reorg
1 parent 7baea9f commit 33f284e

File tree

4 files changed

+63
-62
lines changed

4 files changed

+63
-62
lines changed

docs/signing/get-cert.md

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,17 @@ id: get-cert
33
title: Getting a signing certificate
44
---
55

6-
:::note
6+
:::note Important
77
Best practices for handling keys and certificates are beyond the scope of this documentation. Always protect your private keys with the highest level of security; for example, never share them through insecure channels such as email.
88
:::
99

10-
## Requirements
11-
12-
A signing certificate and key (credentials) must conform to the requirements in the [C2PA specification Trust Model section](https://c2pa.org/specifications/specifications/2.1/specs/C2PA_Specification.html#_trust_model). The certificate must:
13-
14-
- Follow the public key infrastructure (PKI) X.509 V3 specification.
15-
- Have the Key Usage (KU) extension, which must be marked as critical.
16-
- Assert the `digitalSignature` bit.
17-
- Have the Extended Key Usage (EKU) extension. If the Basic Constraints extension is absent or the certificate authority (CA) Boolean is not asserted, the EKU must be non-empty.
18-
- The `anyExtendedKeyUsageEKU` field (2.5.29.37.0) must not be present.
19-
- If the configuration store does not contain a list of EKUs, a certificate that signs C2PA manifests must be valid for the `id-kp-emailProtection` (1.3.6.1.5.5.7.3.4) purpose and/or the `id-kp-documentSigning` (1.3.6.1.5.5.7.3.36) purpose.
10+
To sign manifest claims, you must have an X.509 v3 security certificate and key that conform to the requirements laid out in the [C2PA specification](https://c2pa.org/specifications/specifications/2.1/specs/C2PA_Specification.html#x509_certificates).
2011

2112
## Certificate authorities (CAs)
2213

23-
To get a signing certificate, you must purchase a X.509 v3 security certificate from a certificate authority (CA).
24-
25-
You must select at least one of the extended key usage (EKU) fields that specify what the certificate can be used for: **email protection** and **document signing**. Applications that use the CAI SDK won't accept the certificate unless it has one of these EKUs.
14+
To create or modify Content Credentials, you must purchase a signing certificate from a certificate authority (CA).
2615

27-
There are many CAs that issue certificates. Some of the most popular ones are:
16+
There are many CAs that issue certificates. Some popular ones include:
2817

2918
- GlobalSign: [S/MIME email signing](https://shop.globalsign.com/en/secure-email), [document signing](https://shop.globalsign.com/en/document-signing)
3019
- IdenTrust: [S/MIME email signing](https://www.identrust.com/digital-certificates/secure-email-smime), [document signing](https://www.identrust.com/digital-certificates/document-signing)
@@ -35,22 +24,47 @@ The above list is for reference only; inclusion does not imply endorsement by CA
3524

3625
### Types of certificates
3726

38-
CAs offer a variety of different kinds of certificates (links below are to [Digicert](https://www.digicert.com), but there are many other CAs):
27+
CAs offer a variety of different types of certificates (links below are to [Digicert](https://www.digicert.com), but most CAs offer these types of certificates):
3928

4029
- The simplest and least expensive option is an [S/MIME email certificate](https://www.digicert.com/tls-ssl/compare-secure-email-smime-certificates).
4130
- Other options, such as [document signing certificate](https://www.digicert.com/signing/compare-document-signing-certificates) require more rigor (like proving your identity) and cost more.
4231

43-
### Organization name
32+
### Purchasing a certificate
4433

45-
If you want the C2PA [Verify tool](https://verify.contentauthenticity.org/) to display your organization name in the Content Credentials, your certificate must include the "O" or [Organization Name attribute](https://www.alvestrand.no/objectid/2.5.4.10.html) (OID value 2.5.4.10) in the distinguished name information. The CA may require some validation steps to prove you are part of that organization (details vary by CA).
34+
The process to purchase a certificate and key is different for each CA: You might be able to simply click a "Buy" button on the CA's website. Or your can make your own key and use it to create a certificate signing request (CSR) that you send to the CA. Regardless of the process, what you get back is a signed certificate that you use to create a certificate chain.
4635

47-
## Purchasing a certificate
36+
The certificate chain starts with the certificate from the last tool that signed the manifest (known as the "end-entity") followed by the certificate that signed it, and so on, back to the original CA issuer. This enables a validating application to determine that the manifest is valid because the certificate chain goes back to a trusted root certificate authority.
4837

49-
To create or modify Content Credentials, you must have a valid X.509 v3 security certificate and key that conform to the requirements laid out in the [C2PA specification](https://c2pa.org/specifications/specifications/2.0/specs/C2PA_Specification.html#x509_certificates). You must purchase a certificate from a certificate authority (CA). There are many CAs; some popular ones are listed in [Getting started](getting-started.mdx#getting-a-security-certificate).
38+
### Certificate signing requests (CSRs)
5039

51-
The process to purchase a certificate and key is different for each CA: You might be able to simply click a "Buy" button on the CA's website. Or your can make your own key and use it to create a certificate signing request (CSR) that you send to the CA. Regardless of the process, what you get back is a signed certificate that you use to create a certificate chain.
40+
A CSR is just an unsigned certificate that's a template for the certificate that you're requesting. The CA creates a new certificate with the parameters specified in the CSR, and signs it with their root certificate, which makes it a valid certificate.
5241

53-
The certificate chain starts with the certificate from the last tool that signed the manifest (known as the "end-entity") followed by the certificate that signed it, and so on, back to the original CA issuer. This enables a validating application to determine that the manifest is valid because the certificate chain goes back to a trusted root certificate authority.
42+
A CSR comprises a public key, as well as ["distinguished name" information](https://knowledge.digicert.com/general-information/what-is-a-distinguished-name) that identifies the individual or organization requesting the certificate. The distinguished name includes a common name, organization, city, state, country, and e-mail address. Not all of these fields are required and will vary depending with the assurance level of the desired certificate.
43+
44+
:::tip
45+
For the C2PA [Verify tool](https://verify.contentauthenticity.org/) to display your organization name in the Content Credentials, your CSR must include the "O" or Organization Name attribute in the distinguished name information.
46+
:::
47+
48+
You sign the CSR with your private key; this proves to the CA that you have control of the private key that corresponds to the public key included in the CSR. Once the requested information in a CSR passes a vetting process and domain control is established, the CA may sign the public key to indicate that it can be publicly trusted.
49+
50+
## Certificate requirements
51+
52+
A signing certificate and key (credentials) must conform to the requirements in the [C2PA specification Trust Model section](https://c2pa.org/specifications/specifications/2.1/specs/C2PA_Specification.html#_trust_model). The certificate must:
53+
54+
- Follow the public key infrastructure (PKI) X.509 V3 specification.
55+
- Have the Key Usage (KU) extension, which must be marked as critical.
56+
- Assert the `digitalSignature` bit.
57+
- Have the Extended Key Usage (EKU) extension. If the Basic Constraints extension is absent or the certificate authority (CA) Boolean is not asserted, the EKU must be non-empty.
58+
- The `anyExtendedKeyUsageEKU` field (2.5.29.37.0) must not be present.
59+
- If the configuration store does not contain a list of EKUs, a certificate that signs C2PA manifests must be valid for the `id-kp-emailProtection` (1.3.6.1.5.5.7.3.4) purpose and/or the `id-kp-documentSigning` (1.3.6.1.5.5.7.3.36) purpose.
60+
61+
### Extended key usage (EKU) fields
62+
63+
You must select at least one of the extended key usage (EKU) fields that specify what the certificate can be used for: **email protection** and **document signing**. Applications that use the CAI SDK won't accept the certificate unless it has one of these EKUs.
64+
65+
### Organization name
66+
67+
If you want the C2PA [Verify tool](https://verify.contentauthenticity.org/) to display your organization name in the Content Credentials, your certificate must include the "O" or [Organization Name attribute](https://www.alvestrand.no/objectid/2.5.4.10.html) (OID value 2.5.4.10) in the distinguished name information. The CA may require some validation steps to prove you are part of that organization (details vary by CA).
5468

5569
### Signature types
5670

@@ -69,22 +83,10 @@ The following table describes the signature algorithms and types that the CAI SD
6983
| `id-RSASSA-PSS` - ASN1 OID: secp521r1 | RSA-PSS | ES512<sup>\*</sup> | [RFC 5758 section 3.2](https://www.rfc-editor.org/rfc/rfc5758.html#section-3.2) |
7084
| `id-Ed25519` | EdDSA (Edwards-Curve DSA) with SHA-512 (SHA-2) and Curve25519 | Ed25519 instance ONLY. | [RFC 8410 section 3](https://www.rfc-editor.org/rfc/rfc8410.html#section-3) |
7185

72-
:::info
73-
74-
<a name="table-note"></a>
7586
<sup>*</sup> ES256, ES384, and ES512 signatures must be in IEEE P1363 format.
7687

77-
The information in this table is based on the [C2PA specification Trust Model section](https://c2pa.org/specifications/specifications/2.1/specs/C2PA_Specification.html#_trust_model). The C2PA specification also covers two other certificates for timestamp responses and OCSP certificate revocation, which are not covered here.
78-
79-
### Certificate signing requests (CSRs)
80-
81-
A CSR is just an unsigned certificate that's a template for the certificate that you're requesting. The CA creates a new certificate with the parameters specified in the CSR, and signs it with their root certificate, which makes it a valid certificate.
82-
83-
A CSR comprises a public key, as well as ["distinguished name" information](https://knowledge.digicert.com/general-information/what-is-a-distinguished-name) that identifies the individual or organization requesting the certificate. The distinguished name includes a common name, organization, city, state, country, and e-mail address. Not all of these fields are required and will vary depending with the assurance level of the desired certificate.
88+
---
8489

85-
:::tip
86-
For the C2PA [Verify tool](https://verify.contentauthenticity.org/) to display your organization name in the Content Credentials, your CSR must include the "O" or Organization Name attribute in the distinguished name information. See [below](#organization-name) for details.
87-
:::
90+
The information in this table is based on the [C2PA specification Trust Model section](https://c2pa.org/specifications/specifications/2.1/specs/C2PA_Specification.html#_trust_model). The C2PA specification also covers two other certificates for timestamp responses and OCSP certificate revocation, which are not covered here.
8891

89-
You sign the CSR with your private key; this proves to the CA that you have control of the private key that corresponds to the public key included in the CSR. Once the requested information in a CSR passes a vetting process and domain control is established, the CA may sign the public key to indicate that it can be publicly trusted.
9092

docs/signing/index.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ title: Signing and certificates
77
Be sure to read [Getting started](getting-started.mdx#signing-and-certificates) for some basic background on public-key infrastructure (PKI) technology, certificates, and signing manifests.
88
:::
99

10-
As you're developing an application that uses the CAI SDK, there are three ways to sign manifest claims:
11-
1. [**Initial prototyping and development**](test-certs.md): Use the test certificates and keys included with the SDK libraries to sign claims. These certs and keys are provided for convenience, but aren't valid for actual signing.
12-
1. [**Local/internal testing**](local-signing.md): Once your code is working with the test certs and keys, you're ready to purchase your own certificate from a certificate authority (CA) using your private key. Then for internal testing, your application can use the certificate and key *locally* (i.e. directly from the file system) to sign manifest claims; however, this is NOT safe in production.
13-
1. [**Production testing/deployment**](prod-cert.mdx): To secure your private key for use in a publicly-accessible production application, store it in a hardware security module (HSM) or key management service (KMS). Then your application can access it securely in production.
10+
As you're developing an application that uses the CAI SDK, there are three ways to sign manifest claims, depending on where you are in your development process:
11+
1. **Initial prototyping and development**: Use the test certificates and keys included with the SDK libraries to sign claims. These certs and keys are provided for convenience, but aren't valid for actual signing. For more information, see [Using test certificates](test-certs.md).
12+
1. **Local/internal testing**: Once your code is working with the test certs and keys:
13+
- [Purchase your own certificate](get-cert.md) from a certificate authority (CA).
14+
- Then your application can [use the certificate and key *locally*](local-signing.md) (directly from the file system) to sign manifest claims; however, this is NOT safe in production.
15+
1. **Production testing/deployment**: To secure your private key for use in a publicly-accessible production application, store it in a hardware security module (HSM) or key management service (KMS) where your application can access it securely .
1416

15-
:::warning
17+
:::note
1618
Best practices for handling keys and certificates are beyond the scope of this documentation. Always protect your private keys with the highest level of security; for example, never share them through insecure channels such as email.
17-
:::
19+
:::

docs/signing/local-signing.md

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ To sign a claim in a C2PA manifest you need an end-entity certificate that compl
99

1010
Trust lists connect the end-entity certificate that signed a manifest back to the originating root CA. This is accomplished by supplying the subordinate public X.509 certificates forming the trust chain (the public X.509 certificate chain). If those are not supplied, you can use a private credential store to validate the certificate trust chain. If you do not supply a certificate chain or trust list, validators may reject the manifest. See the C2PA specification for more details.
1111

12-
### Extracting the certificate
13-
14-
To work with the certificate, you need to extract it. When the CAI SDK adds Content Credentials to an asset, it incorporates the certificate (including the associated public key) into the manifest.
15-
16-
:::warning Important
17-
The _private key_ associated with the certificate is extremely sensitive. Always treat it with the highest security to ensure your credentials are not compromised. If someone does obtain your private key, they will be able to sign C2PA manifests and other content on your behalf without your consent.
18-
:::
19-
2012
## Signing a manifest
2113

2214
The simplest way to add a C2PA manifest to an asset file and sign it is by using C2PA Tool (`c2patool`). You can run C2PA Tool manually from the command line (for example, during development) and more generally from any executable program that can call out to the shell, such as a Node.js application as shown in the [c2patool Node.js service example](../c2pa-node-example).
@@ -26,16 +18,12 @@ Similarly, using the Rust SDK, you can [add a manifest to an asset file](https:/
2618
The prerelease libraries for [Node.js](../c2pa-node), [Python](../c2pa-python), and [C++/C](../c2pa-c) can also add and sign a manifest.
2719

2820
:::warning Warning
29-
Accessing a private key and certificate directly from the file system is fine during development, but doing so in production is not ecure. Instead use a Key Management Service (KMS) or a hardware security module (HSM) to access the certificate and key; for example as show in the [C2PA Python Example](https://github.com/contentauth/c2pa-python-example).
21+
Accessing a private key and certificate directly from the file system is fine during development, but doing so in production is not secure. Instead use a Key Management Service (KMS) or a hardware security module (HSM) to access the certificate and key; For more information, see [Using a certificate in production](prod-cert.mdx).
3022
:::
3123

3224
## Example
3325

34-
Here is an example of generating a C2PA-compliant set of credentials using [GlobalSign](http://globalsign.com/) certificate authority (CA).
35-
GlobalSign is just one of many CAs. For a list of some others, see [Getting a security certificate](#getting-a-security-certificate) above.
36-
37-
38-
Credential management is a complex topic and different for every organization. See [above](#overview) for links to best practices.
26+
Here is an example of generating a C2PA-compliant set of credentials using [GlobalSign](http://globalsign.com/) certificate authority (CA). GlobalSign is just one of many CAs. For a list of some others, see [Getting a security certificate](get-cert.md#certificate-authorities-cas).
3927

4028
:::note
4129
This example uses an inexpensive personal certificate, which is fine for development and testing, but for production use an enterprise certificate is strongly recommended. An enterprise certificate is required for [Verify](https://verify.contentauthenticity.org/) to display your organization name when for signed assets.
@@ -51,6 +39,7 @@ The rest of this tutorial uses OpenSSL (a set of cryptographic utilities). If Op
5139

5240
### Step 2: Extract the certificate and key
5341

42+
To work with the certificate, you need to extract it. When the CAI SDK adds Content Credentials to an asset, it incorporates the certificate (including the associated public key) into the manifest.
5443
Use the commands below to extract the key and certificate chain. If prompted, enter the password that was used to generate the `.pfx` file.
5544

5645
:::tip
@@ -117,7 +106,7 @@ Certificate:
117106
.
118107
```
119108

120-
You now have all the needed information to configure C2PA Tool for manifest signing. Edit your [manifest store file](c2patool/docs/manifest.md) to add the following fields that are specific to C2PA Tool:
109+
You now have all the needed information to configure C2PA Tool for manifest signing. Edit your [manifest store file](../c2patool/docs/manifest.md) to add the following fields that are specific to C2PA Tool:
121110

122111
```json
123112
"alg": "ps256",
@@ -127,7 +116,7 @@ You now have all the needed information to configure C2PA Tool for manifest sign
127116

128117
The `private_key` and `sign_cert` properties must be full paths to the key and certificate chain files generated above.
129118

130-
You can now use C2PA Tool [to add a manifest to an image or other asset file](c2patool/docs/usage.md#adding-a-manifest-to-an-asset-file). The command will be something like this:
119+
You can now use C2PA Tool [to add a manifest to an image or other asset file](../c2patool/docs/usage.md#adding-a-manifest-to-an-asset-file). The command will be something like this:
131120

132121
```
133122
c2patool -m my_manifest.json -o signed_image.jpg my_image.jpg
@@ -136,7 +125,7 @@ c2patool -m my_manifest.json -o signed_image.jpg my_image.jpg
136125
The example above uses the information in `my_manifest.json` to add a new manifest to output `signed_image.jpg` using source `my_image.jpg`. The manifest will be signed using the PS256 signature algorithm with private key `mykey.pem`. The manifest will contain the trust chain specified in `mycerts.pem`.
137126

138127
:::warning
139-
This example accesses the private key and certificate directly from the file system, which is fine during development, but is not secure for use in production. Instead, use a hardware security module (HSM) or a Key Management Service (KMS); for example as show in the [C2PA Python Example](c2pa-python-example/readme.md).
128+
This example accesses the private key and certificate directly from the file system, which is fine during development, but is not secure for production use. For more information, see [Using a certificate in production](prod-cert.mdx).
140129
:::
141130

142131
### Confirm it worked

0 commit comments

Comments
 (0)