Inhaltsverzeichnis

CryptoConfig.EnablePostQuantum Method

Enables post-quantum cryptography and initializes the OpenSSL interop.


Definition

namespace WvdS.System.Security.Cryptography
 
public static void EnablePostQuantum(CryptoMode mode = CryptoMode.Hybrid)

Parameters

Name Type Description
mode CryptoMode The mode to enable. Default: CryptoMode.Hybrid

Remarks

This method is a convenience function that:

  1. Sets DefaultMode to the specified value
  2. Initializes OpenSSL and checks the version
  3. Loads the crypto provider

Equivalent to:

CryptoConfig.DefaultMode = mode;
CryptoProviderFactory.GetProvider().Initialize();

Examples

Standard (Hybrid)

// Enables Hybrid mode
CryptoConfig.EnablePostQuantum();
 
// Equivalent to:
CryptoConfig.EnablePostQuantum(CryptoMode.Hybrid);

PostQuantum-Only

// Only for fully PQ-capable environments
CryptoConfig.EnablePostQuantum(CryptoMode.PostQuantum);

Exceptions

DllNotFoundException OpenSSL library not found
InvalidOperationException OpenSSL version < 3.6 or PQ algorithms not available

See Also


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