CoseEcPublicKey Constructor
CoseEcPublicKey(CoseEcCurve, ReadOnlyMemory<byte>, ReadOnlyMemory<byte>)
Construct a CoseEcPublicKey based on the curve and point.
public CoseEcPublicKey(CoseEcCurve curve, ReadOnlyMemory<byte> xCoordinate, ReadOnlyMemory<byte> yCoordinate)
Parameters
Type | Name | Description |
---|---|---|
CoseEcCurve | curve | The curve for this public key. |
ReadOnlyMemory<byte> | xCoordinate | The x-coordinate of the public point. |
ReadOnlyMemory<byte> | yCoordinate | The y-coordinate of the public point. |
Exceptions
Type | Condition |
---|---|
ArgumentException | The xCoordinate or yCoordinate is not the correct length, or when the curve is not supported. |
Remarks
An ECC public key is a curve and public point (x and y coordinates). This constructor expects the length of each coordinate to be at least one byte and 32 bytes or fewer. Valid keys are P-256, P-384, and P-521. Note: Certain keys might not be supported by the YubiKey.
CoseEcPublicKey(CoseEcCurve, CoseAlgorithmIdentifier, ReadOnlyMemory<byte>, ReadOnlyMemory<byte>)
Construct a CoseEcPublicKey based on the curve and x and y coordinates.
public CoseEcPublicKey(CoseEcCurve curve, CoseAlgorithmIdentifier algorithm, ReadOnlyMemory<byte> xCoordinate, ReadOnlyMemory<byte> yCoordinate)
Parameters
Type | Name | Description |
---|---|---|
CoseEcCurve | curve | The curve for this public key. |
CoseAlgorithmIdentifier | algorithm | The algorithm of the key. |
ReadOnlyMemory<byte> | xCoordinate | The x-coordinate of the public point. |
ReadOnlyMemory<byte> | yCoordinate | The y-coordinate of the public point. |
Exceptions
Type | Condition |
---|---|
ArgumentException | The xCoordinate or yCoordinate is not the correct length, or when the curve is not supported. |
Remarks
An ECC public key is a curve and public point (x and y coordinates). Valid keys are P-256, P-384, and P-521. Note: Certain keys might not be supported by the YubiKey.
CoseEcPublicKey(ReadOnlyMemory<byte>)
Construct a CoseEcPublicKey based on the CBOR encoding
of a COSE_Key
.
public CoseEcPublicKey(ReadOnlyMemory<byte> encodedCoseKey)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlyMemory<byte> | encodedCoseKey | The CBOR encoding. |
Exceptions
Type | Condition |
---|---|
Ctap2DataException | The |
CoseEcPublicKey(ECParameters)
Construct a CoseEcPublicKey based on .NET elliptic curve parameters.
public CoseEcPublicKey(ECParameters ecParameters)
Parameters
Type | Name | Description |
---|---|---|
ECParameters | ecParameters | An |
Exceptions
Type | Condition |
---|---|
ArgumentException | The |
NotSupportedException | The parameters/public key specified is not supported. |