Verify Service Provider encryption
If you’re using the Verify Service Provider (VSP) to connect to GOV.UK Verify, you are responsible for keeping its encryption and signing certificates up to date.
If you’re using a custom service provider, go to the section about updating service provider keys.
Rotate your VSP encryption key and certificate
Step 1. Create a new self-signed encryption certificate
Use your preferred method to generate a new private key and self-signed certificate pair.
Make sure the private key is PKCS #8 formatted and PEM encoded.
The self-signed certificate must be:
- valid for one year
- in X.509 format and PEM encoded
Generate your private key and self-signed certificate: The terminal will prompt you for information. You must provide a The There is no mandatory naming convention for For example, the common name could be
See an example
openssl req -x509 -newkey rsa:2048 -days 365 -nodes -sha256 \
-keyout <private-key>.key -out <certificate>.crt
Common Name. All other information is optional.
Common Name is the part of the certificate metadata that helps you identify that certificate more easily. You can use the
Common Name to check you’ve uploaded the right certificate when using the GOV.UK Verify Manage certificates service.
Common Name, but it’s useful during troubleshooting if you include the:
Common Name must not contain underscores.
Generate your private key and self-signed certificate:
The terminal will prompt you for information. You must provide a
There is no mandatory naming convention for
For example, the common name could be
Step 2. Add the new encryption key to the VSP configuration
Add your new VSP private encryption key to
samlSecondaryEncryptionKey in the VSP configuration file.
Restart the VSP to implement the configuration changes. The VSP can now use both the new and old keys to decrypt SAML messages.
Step 3: Upload the new encryption certificate
Upload your new encryption certificate to the GOV.UK Verify Manage certificates service.
This starts a deployment process to replace your old VSP encryption certificate with the new one in the GOV.UK Verify Hub configuration. During deployment the GOV.UK Verify Hub will continue to use your old certificate. The deployment process does not cause any connection downtime.
When the deployment is complete, the GOV.UK Verify Hub will be using your new certificate to encrypt messages for your service.
The deployment process takes approximately 10 minutes. You will receive an email confirmation when the GOV.UK Verify Hub starts using your new encryption certificate. You can also check the deployment status on the GOV.UK Verify Manage certificates service dashboard.
Wait for deployment confirmation before moving to the next step.
Step 4. Remove the old encryption key
The email from the GOV.UK Verify team confirms that GOV.UK Verify Hub is now using your new certificate to encrypt messages for your service. This means you can remove the old encryption key from your VSP configuration.
To remove the old encryption key from the VSP configuration: 1. Remove the key in `samlPrimaryEncryptionKey` and replace it with the key from `samlSecondaryEncryptionKey`. 1. Leave `samlSecondaryEncryptionKey` empty for the next update. 1. Restart the VSP to implement the configuration changes.
Once you’ve removed the old encryption key, your VSP only uses the new encryption key to decrypt messages from GOV.UK Verify Hub.