CryptographySystem

Manages global cryptography configuration: the default provider, provider registry, and default random.

Mutations (setDefaultProvider, registerProvider, setDefaultRandom) should only be called during application initialization before any cryptographic operations. This object is not thread-safe for mutations.

Functions

Link copied to clipboard

Returns the default CryptographyProvider, resolving it on first access.

Link copied to clipboard

Returns the default CryptographyRandom source, resolving it on first access.

Link copied to clipboard

Returns all registered providers sorted by priority (lowest first).

Link copied to clipboard
fun registerProvider(provider: Lazy<CryptographyProvider>, priority: Int)

Adds a lazily-initialized provider to the global registry with the given priority.

Link copied to clipboard

Overrides the default provider with the given provider.

Link copied to clipboard

Overrides the default random source with the given random.