====== CryptoConfig.DefaultMode Property ======
Gets or sets the global crypto mode.
----
===== Definition =====
namespace WvdS.System.Security.Cryptography
public static CryptoMode DefaultMode { get; set; }
----
===== Property Value =====
| Type | [[..:cryptomode|CryptoMode]] |
| Default Value | ''CryptoMode.Classic'' |
----
===== Remarks =====
This property determines the default behavior of all extension methods when no explicit ''CryptoMode'' is passed.
^ Value ^ Behavior ^
| Classic | No PQ extensions |
| Hybrid | RSA/ECDSA + ML-DSA |
| PostQuantum | ML-DSA/ML-KEM only |
----
===== Examples =====
==== Global Configuration ====
// At application startup
CryptoConfig.DefaultMode = CryptoMode.Hybrid;
// All subsequent operations use Hybrid
var cert = request.CreateSelfSigned(notBefore, notAfter);
// cert.HasPqSignature() == true
==== Override per Operation ====
CryptoConfig.DefaultMode = CryptoMode.Classic;
// This operation uses PostQuantum anyway
var pqCert = request.CreateSelfSigned(
notBefore,
notAfter,
CryptoMode.PostQuantum);
----
===== Thread Safety =====
This property is thread-safe. Changes are immediately visible to all threads.
----
===== See Also =====
* [[.:start|CryptoConfig Class]]
* [[..:cryptomode|CryptoMode Enum]]
* [[.:enablepostquantum|EnablePostQuantum Method]]
{{tag>property}}
----
//Wolfgang van der Stille @ EMSR DATA d.o.o. - Post-Quantum Cryptography Professional//