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

Org.BouncyCastle.Security.SignerUtilities

public static class SignerUtilities
Factory for ISigner instances and helpers for resolving signature algorithm metadata (X.509 algorithm parameters, OID lookup) from algorithm names or OIDs.
public static ICollection<string> Algorithms { get; }

The set of canonical signature algorithm names recognised by this factory.

Returns the default X.509 AlgorithmIdentifier parameters block for the given signature algorithm OID. For RSASSA-PSS variants this constructs a populated RSASSA-PSS-params structure; for most other algorithms Instance is returned.

public static Asn1Encodable GetDefaultX509Parameters(string algorithm)

Returns the default X.509 AlgorithmIdentifier parameters block for the named signature algorithm. See the OID overload for behaviour.

public static string GetEncodingName(DerObjectIdentifier oid)

Returns the canonical signature algorithm name registered for the given ASN.1 OID, or null if the OID is not mapped.

public static DerObjectIdentifier GetObjectIdentifier(string mechanism)

Returns an ObjectIdentifier for a given signature mechanism.

Resolve and instantiate an ISigner for the given ASN.1 algorithm OID.

public static ISigner GetSigner(string algorithm)

Resolve and instantiate an ISigner by name (e.g. "SHA256withRSA", "SHA1withECDSA", "Ed25519").

public static ISigner InitSigner(DerObjectIdentifier algorithmOid, bool forSigning, AsymmetricKeyParameter privateKey, SecureRandom random)

Resolve a signer for the given OID and initialise it for signing or verification.

public static ISigner InitSigner(string algorithm, bool forSigning, AsymmetricKeyParameter privateKey, SecureRandom random)

Resolve a signer by name and initialise it for signing or verification. See the OID overload for parameter semantics.