<PackageReference Include="BouncyCastle.Cryptography" Version="2.7.0" />

Org.BouncyCastle.Utilities.Properties

public static class Properties
Utility methods for managing properties.
public static readonly string Argon2MaxMemoryExp

The maximum permitted memory exponent (i.e. memory <= (1 << MaxMemoryExp).

public static readonly string Argon2MaxParallelism

The maximum Argon2 parallelism (lanes) accepted when a key is derived from untrusted cost parameters.

public static readonly string Argon2MaxPasses

The maximum number of Argon2 passes (iterations) accepted when a key is derived from untrusted cost parameters.

public static readonly string Asn1AllowUnsafeInteger

public static readonly string Asn1MaxDepth

public static readonly string Asn1MaxLimit

public static readonly string CmsAllowLenientRsaPkcs1

Allow legacy RSA PKCS#1 v1.5 key-transport unwrap in CMS when the content-encryption key has no fixed size.

public static readonly string DHMaxSize

public static readonly string DsaMaxSize

public static readonly string ECF2mMaxSize

public static readonly string ECFpCertainty

public static readonly string ECFpMaxSize

public static readonly string FpeDisable

public static readonly string FpeDisableFf1

public static readonly string PbeMaxIterationCount

Upper bound on the PBKDF2 iteration count honoured when decrypting a PBES2-protected PKCS#8/PEM private key.

public static readonly string PbeMaxScryptMemory

Upper bound, in bytes, on the scrypt working memory (~128 * N * r) honoured when decrypting a PBES2-protected PKCS#8 / PEM private key.

public static readonly string Pkcs12IgnoreUselessPassword

When set to true, suppresses the error raised when loading a PKCS12 store with a password, for data that does not require a password.

public static readonly string Pkcs12MaxIterationCount

If set, a PKCS12 file with a larger iteration count on PBE processing will be rejected. Default 5,000,000.

public static readonly string Pkcs1NotStrict

public static readonly string PKMacMaxIterationCount

Upper bound on the RFC 4211 PKMAC / CMP password-based-MAC iteration count honoured when no explicit ceiling is supplied.

public static readonly string RsaAllowUnsafeModulus

public static readonly string RsaMaxMRTests

public static readonly string RsaMaxSize

public static readonly string X509AllowLenientIPAddressMask

Salvage a non-contiguous iPAddress name-constraint subnet mask instead of rejecting it. An iPAddress name constraint carries a subnet mask expected to be CIDR (a run of leading 1-bits); a non-contiguous mask is malformed per RFC 4632 and also lets the subtree set-algebra mint new ranges (a super-linear blow-up on hostile input). By default such a constraint is rejected (fail-closed). When set, the mask is instead rounded to the most-restrictive contiguous mask for its context - a permitted subtree is narrowed (fill up to the last 1-bit; under-permit), an excluded subtree is broadened (keep only the leading 1-bits; over-exclude) - so validation can only get stricter, never laxer. Strict rejection is the default; this is a safety valve, not a recommended mode.

public static readonly string X509AllowLenientRfc822Name

Fall back to the legacy lenient parsing of rfc822Name values in X.509 name-constraint checks. By default the validator is strict about rfc822Name conformance; today that means a tested rfc822Name with more than one '@' is rejected as ambiguous when email constraints apply (RFC 5321 sec. 4.1.2 allows '@' inside a quoted local part, so the domain is not simply the text after the first '@', and a wrong split could evade a constraint). When set, that strictness (and any future rfc822Name conformance strictness) is disabled and the historical permissive parsing is used instead. Strict is the default; set this only to restore the old behaviour. This is a safety valve, not a recommended mode.

public static readonly string X509AllowNonDerTbsCertificate

public static readonly string X509MaxPolicyNodes

public static readonly string X509Sgp22NameConstraints

Opt in to the relaxed directoryName name-constraint matching required by GSMA SGP.22 v2.5 (Remote SIM Provisioning), sections 4.5.2.1.0.2 / 4.5.2.1.0.3. When set, a permitted-subtree RDN is satisfied by any matching subject RDN regardless of position, additional subject attributes beyond those named in the subtree are tolerated, and a serialNumber RDN is matched with a StartsWith comparison wherever it appears. This is deliberately looser than the contiguous-prefix DN matching mandated by RFC 5280 7.1, so it defaults to off and must be enabled explicitly; BC's default validation remains RFC 5280 strict.

public static void Clear()

public static void ClearThreadProperties()

public static bool GetBoolean(string propertyName, bool defaultValue)

public static int GetInt32(string propertyName, int defaultValue)

public static long GetInt64(string propertyName, long defaultValue)

public static string GetProperty(string name)

Return the string value of the property name.

public static string GetProperty(string name, string defaultValue)

Return the string value of the property name, or defaultValue if that property is not defined.

public static string GetThreadProperty(string name)

public static bool RemoveThreadProperty(string name)

public static void SetThreadBoolean(string propertyName, bool propertyValue)

public static void SetThreadInt32(string propertyName, int propertyValue)

public static void SetThreadInt64(string propertyName, long propertyValue)

public static void SetThreadProperty(string name, string value)

public static bool TryGetBoolean(string propertyName, out bool propertyValue)

public static bool TryGetInt32(string propertyName, out int propertyValue)

public static bool TryGetInt64(string propertyName, out long propertyValue)

public static void WithThreadProperty(string name, string value, Action action)

public static TResult WithThreadProperty<TResult>(string name, string value, Func<TResult> func)

public static TResult WithThreadProperty<TArg, TResult>(string name, string value, TArg arg, Func<TArg, TResult> func)