Quick Reference

Compact code examples for quick start. For detailed explanations, see the linked scenarios.


PKI & Certificates

Example Description Details
PKI Infrastructure Root CA, Intermediate CA, hierarchy -> PKI Scenarios
Create CSR Server, client, code signing -> CSR Scenarios
Certificate Management Renew, re-key, revoke -> Management Scenarios
Validation Chain, hostname, key usage -> Validation Scenarios

Signatures

Example Description Details
Digital Signatures RSA, ECDSA, CMS hybrid -> Signature Scenarios

Key Exchange & Encryption

Example Description Details
Encryption ML-KEM, hybrid, AES-GCM -> Encryption Scenarios
Key Management Generation, rotation, backup -> Key Scenarios

Import/Export

Example Description Details
Import/Export PEM, PFX, PKCS#7 -> Import/Export Scenarios

Quick Start: Complete Workflow

using WvdS.System.Security.Cryptography;
using WvdS.System.Security.Cryptography.KeyExchange;
using WvdS.System.Security.Cryptography.Encryption;
 
// 1. Configuration
CryptoConfig.DefaultMode = CryptoMode.Hybrid;
 
// 2. Key Exchange
using var mlKem = MlKem.Create(MlKemParameterSet.MlKem768);
byte[] publicKey = mlKem.ExportPublicKey();
 
// Sender: Encapsulate
var encap = MlKem.Encapsulate(publicKey);
byte[] ciphertext = encap.Ciphertext;
byte[] senderSecret = encap.SharedSecret;
 
// Receiver: Decapsulate
byte[] receiverSecret = mlKem.Decapsulate(ciphertext);
 
// 3. Key Derivation
byte[] aesKey = KeyDerivationExtensions.DeriveKey(
    receiverSecret,
    outputLength: 32,
    info: Encoding.UTF8.GetBytes("AES-256-GCM"));
 
// 4. Encryption
var aes = new Aes256Gcm(aesKey);
byte[] encrypted = aes.Encrypt(plaintext);
byte[] decrypted = aes.Decrypt(encrypted);

Further Reading


Wolfgang van der Stille @ EMSR DATA d.o.o. - Post-Quantum Cryptography Professional

Zuletzt geändert: on 2026/01/29 at 11:38 PM