Create Your Signing Certificate

Digitally signing documents requires a signing certificate in .p12 format. You can either purchase one or create a free self-signed certificate.

Follow the steps below to create a free, self-signed certificate for local development.

1

Generate Private Key
2

Generate a private key using OpenSSL by running the following command:
3

openssl genrsa -out private.key 2048
4

This command generates a 2048-bit RSA key.
5

Generate Self-Signed Certificate
6

Using the private key, generate a self-signed certificate by running the following command:
7

openssl req -new -x509 -key private.key -out certificate.crt -days 365
8

You will be prompted to enter some information, such as the certificate’s Common Name (CN). Ensure that you provide the correct details. The —days parameter specifies the certificate’s validity period.
9

Create p12 Certificate
10

Combine the private key and the self-signed certificate to create a .p12 certificate. Use the following command:
11

openssl pkcs12 -export -out certificate.p12 -inkey private.key -in certificate.crt -legacy
12

p12 Certificate Password
13

When you create the .p12 certificate, you will be prompted to enter a password. Enter a strong password and keep it secure. Remember this password, as it will be required when using the certificate.
14

Note that for local development, the password can be left empty.
15

Add Certificate to the Project
16

Use the NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH environment variable to point at the certificate you created.
17

Details about environment variables associated with certificates can be found here.