Certificates
AS2 uses X.509 certificates for encryption and digital signatures. Manage your certificates and your trading partners' public certificates through the web UI.
Certificate Types
AS2 communications require two types of certificates:
- Your Certificate (with Private Key) - Used to sign outgoing messages and decrypt incoming messages. Keep this secure!
- Partner's Public Certificate - Used to encrypt messages to the partner and verify their signatures.
Certificate List
The Certificate list shows all configured certificates with download capabilities:
Downloading Certificates
There are two places to download certificates, each serving different purposes:
From Certificate List Page
The Download button on the Certificate list provides options to export your keystore:
| Option | Contents | Purpose |
|---|---|---|
| Complete KeyStore (.p12) | Your private key + your certificate + partner's certificate | Backup, migration, or importing to another system |
| Partner Certificate (.p12) | Only the partner's public certificate | Export partner's certificate for use elsewhere |
Both downloads use the same password you set when creating the certificate.
The Complete KeyStore contains your private key. Never share this with trading partners!
From Partnership Page
The Download PublicKey button on the Partnership detail page downloads your public certificate in PEM format (.cer):
| Option | Format | Purpose |
|---|---|---|
| Download PublicKey | PEM (.cer) | Share with your trading partner so they can encrypt messages to you and verify your signatures |
For trading partners: Use "Download PublicKey" from the Partnership page - this is safe to share.
For yourself: Use "Complete KeyStore" from the Certificate list for backup or migration.
Adding Certificates
To add a certificate for a partnership:
Option A: Auto-Generate Certificate
If you don't have an existing certificate, ServerlessAS2 will generate one for you:
-
Select Partnership
Choose the AS2 Instance and Partner for this certificate.
-
Set Password and Private Key Alias
Enter a password to protect the keystore. The
privateKeyAliasfield is auto-populated from your AS2 Instance'smy_as2_aliasvalue - this identifies your private key within the keystore. -
Upload Partner Certificate
Upload your partner's public certificate (.cer/.crt/.pem format). The alias is auto-populated from the partner's configuration.
-
Save
Click Save. ServerlessAS2 will automatically generate a self-signed certificate for you.
Option B: Import Your Own Certificate
If you have an existing PKCS#12 certificate:
-
Select Partnership
Choose the AS2 Instance and Partner for this certificate.
-
Enter Password
Enter the password that was used to protect your P12/PFX file. This is required to unlock and read the imported keystore.
-
Enter Private Key Alias
Enter the alias of the private key entry inside your imported keystore. This must match the actual alias used when the P12 file was created. If you're unsure, use tools like
keytool -list -keystore your.p12 -storetype PKCS12to view the aliases. -
Import Your Certificate
Click "Import Your Certificate" and upload your PKCS#12 (.p12/.pfx) file.
-
Upload Partner Certificate
Upload your partner's public certificate (.cer/.crt/.pem format).
-
Save
Click Save to store the certificates securely.
Field Reference
| Field | Required | Description |
|---|---|---|
my_as2_id |
Yes | Your AS2 Instance identifier. Select from your configured AS2 Instances. |
partner_as2_id |
Yes | The trading partner's AS2 identifier. Select from your configured Partners. |
password |
Yes | When auto-generating: password to protect the new keystore. When importing: password to unlock your existing P12/PFX file. Cannot be changed after creation. |
privateKeyAlias |
Yes | When auto-generating: auto-populated from your AS2 Instance's my_as2_alias - used as the alias for the generated private key. When importing: must match the actual alias of the private key entry inside your imported P12 file. Used for signing outgoing messages and decrypting incoming messages. Cannot be changed after creation. |
alias |
No | The alias for the partner's public certificate in the keystore. Auto-populated from the partner's configuration. |
Auto-generating: The privateKeyAlias is auto-populated from your AS2 Instance's my_as2_alias. This ensures consistency - your AS2 alias becomes your key alias in the keystore.
Importing: The privateKeyAlias must match the alias already used inside your P12 file. To find this, run: keytool -list -keystore your.p12 -storetype PKCS12
Certificate Formats
| Format | Extension | Use Case |
|---|---|---|
| PKCS#12 | .p12, .pfx | Your certificate with private key (password protected) |
| X.509 DER | .cer, .crt | Partner's public certificate (binary) |
| X.509 PEM | .pem, .crt | Partner's public certificate (base64) |
Certificates expire! Monitor expiration dates and coordinate with trading partners to exchange new certificates before expiry. CA certificate lifespans are shrinking to 47 days by 2029.
Partner Certificate Rotation
When your trading partner rotates their certificate (due to expiration, security policy, or key compromise), you need to update their public certificate in your system.
When to Rotate
- Partner notification - Partner sends you a new certificate before their current one expires
- Certificate expiration - Partner's certificate is approaching or has passed its expiry date
- Security incident - Partner's private key was compromised and they issued a new certificate
- Signature verification failures - Incoming messages fail signature verification (may indicate partner started using a new certificate)
Rotation Steps
-
Obtain the New Certificate
Get the new public certificate from your trading partner. They should provide it in .cer, .crt, or .pem format.
-
Go to Certificate List
Navigate to the Certificate tab and find the certificate entry for the partnership.
-
Edit the Certificate
Click on the certificate entry to edit it.
-
Upload New Partner Certificate
In the certificate section, upload the new partner certificate file. This replaces the old partner public key while keeping your private key intact.
-
Save and Test
Save the changes and send a test message to verify the new certificate works correctly.
Partner certificate rotation only updates the partner's public key. Your private key and certificate remain unchanged. If you need to rotate your own certificate, you'll need to generate a new one and share the public key with your partner.
Best Practices
- Plan ahead - Request new certificates from partners at least 2 weeks before expiration
- Test in staging - If possible, test the new certificate in a non-production environment first
- Coordinate timing - Agree on a switchover time with your partner to minimize disruption
- Keep backups - Download your complete keystore before making changes
- Monitor after rotation - Watch message tracking for any signature or encryption errors after the switch