Crescendo SDK
Loading...
Searching...
No Matches
CrescendoDLL.PCSC.FIDODataStructures.COSEKey Class Reference

Represents a COSE (CBOR Object Signing and Encryption) key, as defined in FIDO CTAP2 Specification. This class is used to store cryptographic key information used in FIDO authentication. More...

Public Member Functions

 COSEKey (byte[] xCoordinate, byte[]? yCoordinate=null, int algorithm=-25, int curve=1, int keyType=2)
 Initializes a new instance of the COSEKey class.
 

Properties

int Algorithm [get, set]
 Algorithm identifier - Corresponds to the COSE alg parameter (algorithm). Represents the cryptographic algorithm used with the key. For example, -25 for ES256 (ECDSA with SHA-256). See IANA COSE Algorithms registry.
 
int Curve [get, set]
 Curve identifier - corresponds to the COSE crv parameter. Applies to both EC2 and OKP key types. For example, 1 for P-256, 6 for Ed25519, 7 for X25519. See IANA COSE Elliptic Curves registry.
 
int KeyType [get, set]
 Key type - Corresponds to the COSE kty> parameter (key type). Common values: 1 for OKP (e.g. Ed25519), 2 for EC2 (e.g. P-256). See IANA COSE Key Types registry.
 
byte[] XCoordinate [get, set]
 Byte array representing the X coordinate. Corresponds to the COSE x parameter.
 
byte?[] YCoordinate [get, set]
 Byte array representing the Y coordinate. Corresponds to the COSE y parameter. null for OKP keys (e.g. Ed25519, kty=1) which carry only an X parameter.
 

Detailed Description

Represents a COSE (CBOR Object Signing and Encryption) key, as defined in FIDO CTAP2 Specification. This class is used to store cryptographic key information used in FIDO authentication.

Constructor & Destructor Documentation

◆ COSEKey()

CrescendoDLL.PCSC.FIDODataStructures.COSEKey.COSEKey ( byte[]  xCoordinate,
byte?[]  yCoordinate = null,
int  algorithm = -25,
int  curve = 1,
int  keyType = 2 
)
inline

Initializes a new instance of the COSEKey class.

Parameters
xCoordinateThe X coordinate (EC2) or public key bytes (OKP).
yCoordinateThe Y coordinate. Pass null for OKP keys (e.g. Ed25519) which have no Y parameter.
algorithmAlgorithm identifier - Corresponds to the COSE alg parameter (algorithm). Set to -25 (ECDSA with SHA-256) by default.
curveCurve identifier - corresponds to the COSE crv parameter. Set to 1 (P-256) by default.
keyTypeKey type - Corresponds to the COSE kty parameter (key type). Set to 2 (EC2) by default.

References CrescendoDLL.PCSC.FIDODataStructures.COSEKey.Algorithm, CrescendoDLL.PCSC.FIDODataStructures.COSEKey.Curve, CrescendoDLL.PCSC.FIDODataStructures.COSEKey.KeyType, CrescendoDLL.PCSC.FIDODataStructures.COSEKey.XCoordinate, and CrescendoDLL.PCSC.FIDODataStructures.COSEKey.YCoordinate.

Property Documentation

◆ Algorithm

int CrescendoDLL.PCSC.FIDODataStructures.COSEKey.Algorithm
getset

Algorithm identifier - Corresponds to the COSE alg parameter (algorithm). Represents the cryptographic algorithm used with the key. For example, -25 for ES256 (ECDSA with SHA-256). See IANA COSE Algorithms registry.

Referenced by CrescendoDLL.PCSC.FIDODataStructures.COSEKey.COSEKey().

◆ Curve

int CrescendoDLL.PCSC.FIDODataStructures.COSEKey.Curve
getset

Curve identifier - corresponds to the COSE crv parameter. Applies to both EC2 and OKP key types. For example, 1 for P-256, 6 for Ed25519, 7 for X25519. See IANA COSE Elliptic Curves registry.

Referenced by CrescendoDLL.PCSC.FIDODataStructures.COSEKey.COSEKey().

◆ KeyType

int CrescendoDLL.PCSC.FIDODataStructures.COSEKey.KeyType
getset

Key type - Corresponds to the COSE kty> parameter (key type). Common values: 1 for OKP (e.g. Ed25519), 2 for EC2 (e.g. P-256). See IANA COSE Key Types registry.

Referenced by CrescendoDLL.PCSC.FIDODataStructures.COSEKey.COSEKey().

◆ XCoordinate

byte [] CrescendoDLL.PCSC.FIDODataStructures.COSEKey.XCoordinate
getset

Byte array representing the X coordinate. Corresponds to the COSE x parameter.

Referenced by CrescendoDLL.PCSC.FIDODataStructures.COSEKey.COSEKey().

◆ YCoordinate

byte? [] CrescendoDLL.PCSC.FIDODataStructures.COSEKey.YCoordinate
getset

Byte array representing the Y coordinate. Corresponds to the COSE y parameter. null for OKP keys (e.g. Ed25519, kty=1) which carry only an X parameter.

Referenced by CrescendoDLL.PCSC.FIDODataStructures.COSEKey.COSEKey().