Skip to main content

COSEAlgorithmIdentifier

Namespace: Wisej.Ext.WebAuthn

Assembly: Wisej.Ext.WebAuthn (4.1.0.0)

Identifies a cryptographic algorithm.

public enum COSEAlgorithmIdentifier

The values match the COSE algorithm identifiers registered with IANA. Validate supports ES256 and RS256. See #typedefdef-cosealgorithmidentifier.

Example:

// Accept ES256 (preferred) and RS256 keys during registration.
var parameters = new[]
{
new PublicKeyCredentialParameters(COSEAlgorithmIdentifier.ES256),
new PublicKeyCredentialParameters(COSEAlgorithmIdentifier.RS256)
};

// Check the algorithm of a stored public key.
if (publicKey.Algorithm == COSEAlgorithmIdentifier.ES256)
Console.WriteLine("Elliptic curve key (P-256).");

Fields​

NameDescriptionValue
EdDSAEdDSA algorithm.
ES256ES256 algorithm.
ES384ES384 algorithm.
ES512ES512 algorithm.
RS256RS256 algorithm.

Used By​

NameDescription
PublicKey.AlgorithmThe public key algorithm used.
PublicKeyCredentialParameters.AlgSpecifies the cryptographic signature algorithm with which the newly generated credential will be used, and thus also the type of asymmetric key pair to be generated, e.g., RSA or Elliptic Curve.