Configure PublicKeyAlgorithm for GenerateKey
masterWhen calling GenerateKey, the PublicKeyAlgorithm determines the algorithm for the master key (which must be capable of signing/certifying). PgpCore automatically selects a matching encryption subkey algorithm based on your choice.
| PublicKeyAlgorithm | Master key | Encryption subkey |
|---|---|---|
RsaGeneral (Default) | RSA | RSA |
RsaEncrypt | RSA | RSA |
RsaSign | RSA | RSA |
EdDsa | Ed25519 | X25519 ECDH |
ECDsa | NIST P-256 | NIST P-256 ECDH |
Dsa | DSA | RSA |
Important Notes:
- Algorithms like
ECDH,ElGamalEncrypt,ElGamalGeneral, orDiffieHellmanwill throw aNotSupportedExceptionbecause they cannot be used for a master key. - For
Dsa, PgpCore uses an RSA encryption subkey instead of ElGamal to avoid long generation times. Dsastrengths must be a multiple of 64 (e.g., 512, 1024) if using BouncyCastle constraints.