<PackageReference Include="BouncyCastle.Cryptography" Version="2.8.0-beta.349" />

Org.BouncyCastle.Utilities.Properties

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

Allow Argon2 parameters with a memory size below the minimum of 8 * parallelism KiB that RFC 9106 sec. 3.1 requires.

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 CmsAllowLegacyKeyAgreeKdf

Allow CMS key-agreement recipients to retry the key-encryption-key derivation in known non-standard forms, if the standard derivation fails to unwrap the content-encryption key.

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 GostAllowLenientKeyParameters

Allow GOST key AlgorithmIdentifier parameters that do not match the structure required for the key algorithm, where earlier bc-csharp versions could write them.

public static readonly string LmsMaxSeedLength

The largest SEED, in bytes, accepted in an LMS or HSS private key encoding. Default 1024.

public static readonly string OcspMaxResponseSize

The largest OCSP response, in bytes, to accept from a responder. Default 64KiB.

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 Pkcs12StoreIterationCount

The PBE iteration count the PKCS12 keystore uses when writing a file - the write-side counterpart of Pkcs12MaxIterationCount, which only bounds what is accepted on load. Default 300,000 for the key and certificate encryption, twice that for the integrity MAC.

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 X509AllowEmptyIssuerCert

If set to "true", certificate parsers will accept a certificate whose issuer is an empty distinguished name. RFC 5280 sec. 4.1.2.4 requires the issuer field to contain a non-empty DN and the parser rejects an empty one by default, but some non-PKIX certificate profiles - notably the libp2p TLS profile, which uses a self-signed certificate purely as a peer-identity carrier - place no requirements on the issuer and such certificates are in circulation. This is a read-side concession only: certificate generation still requires a non-empty issuer unconditionally.

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 X509MaxCertPathBuildNodes

Upper bound on the total number of nodes the PKIX CertPath builder visits while searching for a chain. The builder does a depth-first walk up the PKI graph, bounded per path by cycle detection and the caller's maxPathLength. Because candidate issuers are matched by subject name only, a certificate store containing many certificates that share a subject name without chaining to a trust anchor can make the search explore a large number of partial paths before it concludes no chain exists. This bound keeps that work predictable: the visited-node count is checked on entry to each build step and the build is aborted once it exceeds the bound.

public static readonly string X509MaxPolicyNodes

Upper bound on the total number of valid-policy-tree nodes retained (across all depth levels) during PKIX CertPath validation. Certificate policy mapping combined with the anyPolicy expansion of RFC 5280 6.1.3/6.1.4 can grow the tree multiplicatively per certificate, so a crafted chain that still chains to a trust anchor could drive the validator into exponential memory/CPU consumption - a denial of service. The tree size is checked once per certificate and validation is aborted once it exceeds this bound.

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)