SAP Knowledge Base Article - Public

3838269 - PGP Encrypted File Cannot Be Decrypted When Public Key Contains a Separate Encryption Subkey

Symptom

  • You have uploaded a PGP public key to SuccessFactors for file encryption (export job type). The file is generated successfully, but you're unable to decrypt it using their private key.
  • Upon inspection, your public key contains a Primary Key (used for signing) and a separate Encryption Subkey (used for encrypting files). The error reported might vary depends on which decrypt tool you are using, one example is: com.sap.esb.camel.security.pgp.PgpException: An exception occurred during decrypting/verifying a PGP message. Reason: PGP message is encrypted with a key which could not be found in the Secret Keyring. Cause: iaik.pgp.exceptions.PGPException: PGP message is encrypted with a key which could not be found in the Secret Keyring.

Environment

SAP SuccessFactors HCM Suite

Reproducing the Issue

1. Generate a PGP key pair using a modern PGP tool (e.g. GnuPG 2.1+, Kleopatra, GPG Suite) with default settings.
2. Upload the public key to SuccessFactors Admin Center as the encryption key.
3. Trigger a file encryption job.
4. Attempt to decrypt the received file using the corresponding private key.
5. Decryption fails — the session key was encrypted to the Primary Key, not the Encryption Subkey.

Cause

SuccessFactors PGP encryption does not support public keys where the encryption capability is delegated to a separate subkey. When a public key with this structure is uploaded, the system encrypts the file using the Primary Key instead of the designated Encryption Subkey. As a result, you're unable to decrypt the file using their private key.
 
This affects all PGP public keys generated following the RFC 4880 standard, which recommends delegating encryption to a dedicated subkey. Most modern PGP tools (GnuPG 2.1+, Kleopatra, GPG Suite, etc.) generate this structure by default. Please refer to PGP sign limitation - PGP Keys Used in Scheduled Jobs | SAP Help Portal

Resolution

To verify the key structure, run:

```

gpg -k <KEY_ID>
```
If the output shows `[SC]` on the `pub` line and `[E]` on the `sub` line, the key is affected.

How to verify your key is compatible:
 
Run the following command and check the `pub` line:

```bash

gpg -k <KEY_ID>
```
The `pub` line must include `E` in the capability flags (e.g. `[SE]`, `[SCE]`). If it shows only
`[SC]` with a separate `sub [E]` line, the key is not supported.
 
Generating a compatible key using GnuPG (batch mode):
 
Create a parameter file `keygen.txt` with the following content:

```

Key-Type: RSA
Key-Length: 4096
Key-Usage: encrypt,sign
Name-Real: Your Name
Name-Email: your@email.com
Expire-Date: 1y
%commit
```
 
> `Expire-Date` controls the key expiration. Use `0` for no expiration, a specific date
> (e.g. `2027-12-31`), or a duration (e.g. `1y` for 1 year, `6m` for 6 months).
 
Then run:

```bash

gpg --batch --gen-key keygen.txt
```

This generates a primary key with `[SCE]` capability and no separate encryption subkey,
which is compatible with SuccessFactors.

See Also

Keywords

INC37087149, PGP, encryption, decryption error, Secret Keyring, iaik.pgp.exceptions.PGPException, primary key, encryption subkey, PGP Key Management, Admin Center, SFTP, GnuPG, key usage encrypt sign, key chain, export job , KBA , LOD-SF-PLT-PGP , PGP Key Generation , Problem

Product

SAP SuccessFactors Platform all versions