Public Key Infrastructure (PKI)

The foundation of modern digital security: asymmetric cryptography enables secure communication without shared secrets.

Asymmetric Cryptography Basics

Unlike symmetric encryption where both parties share the same secret key, asymmetric cryptography uses a key pair: a private key that must be kept secret, and a public key that can be freely shared.

🔐 Private Key

  • Must be kept absolutely secret
  • Used to decrypt data encrypted with your public key
  • Used to sign data (proving you are the sender)
  • Should be protected by hardware (HSM) or strong passphrase
  • If compromised, all security is lost

🌐 Public Key

  • Can be freely distributed to anyone
  • Used to encrypt data that only you can decrypt
  • Used to verify signatures you created
  • Embedded in certificates for identity verification
  • Cannot be used to derive the private key

Encryption vs. Digital Signatures

The key pair can be used in two opposite directions, serving different security purposes.

📨 Encryption (Confidentiality)

Goal: Only the intended recipient can read the message.

Sender encrypts with recipient's PUBLIC key
→ Only recipient can decrypt with their PRIVATE key

Example: You want to send a secret message to Alice. You encrypt it with Alice's public key. Only Alice can decrypt it with her private key.

✍️ Digital Signature (Authenticity)

Goal: Prove the message came from you and wasn't modified.

Sender signs with their PRIVATE key
→ Anyone can verify with sender's PUBLIC key

Example: You sign a document with your private key. Anyone with your public key can verify that you (and only you) signed it.

What is a Certificate?

A certificate is a signed statement that binds a public key to an identity (person, server, organization).

📜 Certificate Contents

Subject:Who owns this certificate (e.g., 'example.com' or 'Alice Smith')Public Key:The subject's public keyIssuer:Who signed this certificate (the Certificate Authority)Validity:Not before / not after datesSignature:The CA's digital signature over all the above

The Trust Chain

🏛️
Root CA

Self-signed, trusted by OS/browser

🔗
Intermediate CA

Signed by Root CA

🌐
End Certificate

Signed by Intermediate

Who Needs What?

A quick reference for common PKI operations.

OperationYou NeedPurpose
Encrypt a message to BobBob's public keyOnly Bob can decrypt
Decrypt a message sent to youYour private keyAccess confidential content
Sign a documentYour private keyProve it came from you
Verify Bob's signatureBob's public key (certificate)Confirm Bob signed it
Issue a certificateCA's private keyCA signs the certificate
Verify a certificateCA's public key (root cert)Confirm CA issued it

BSI TR-02102: Recommended Algorithms

The German Federal Office for Information Security (BSI) publishes TR-02102 with cryptographic recommendations valid until 2031+.

Signature Algorithms

AlgorithmMin. Key LengthSecurity LevelValid UntilYubiHSM 2Note
RSA≥ 3000 bits~100-120 bit2031+Binding since 2024
ECDSA P-256256 bits~128 bit2031+NIST curve, widely supported
ECDSA P-384384 bits~192 bit2031+Higher security margin
Ed25519256 bits~128 bit2031+Modern, deterministic signing
Ed448448 bits~224 bit2031+Highest security EdDSA

Hash Functions

AlgorithmOutput SizeStatusYubiHSM 2Use Case
SHA-1160 bits❌ Deprecated⚠️Do not use for signatures
SHA-256256 bits✅ RecommendedStandard choice
SHA-384384 bits✅ RecommendedHigher security margin
SHA-512512 bits✅ RecommendedMost secure against future attacks

💡 Practical Recommendation

For new PKI deployments, use ECDSA P-384 with SHA-384 or Ed25519 for end-entity certificates. For root and intermediate CAs that need long validity periods, consider RSA-4096 with SHA-512 for maximum compatibility and security margin. All recommended algorithms are supported by YubiHSM 2 for hardware-protected key storage.

Implement PKI with Signando CA

Build your own certificate authority with hardware-backed key protection.

Explore Signando CAWhy HSM Matters