Show / Hide Table of Contents

CoseEcPublicKey Constructor

CoseEcPublicKey(CoseEcCurve, ReadOnlyMemory<byte>, ReadOnlyMemory<byte>)

Construct a CoseEcPublicKey based on the curve and point.

C#
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.

C#
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.

C#
public CoseEcPublicKey(ReadOnlyMemory<byte> encodedCoseKey)

Parameters

Type Name Description
ReadOnlyMemory<byte> encodedCoseKey

The CBOR encoding.

Exceptions

Type Condition
Ctap2DataException

The encodedCoseKey is not a correct EC Public Key encoding.

CoseEcPublicKey(ECParameters)

Construct a CoseEcPublicKey based on .NET elliptic curve parameters.

C#
public CoseEcPublicKey(ECParameters ecParameters)

Parameters

Type Name Description
ECParameters ecParameters

An ECParameters structure with a specified Curve and a public point Q.

Exceptions

Type Condition
ArgumentException

The ECParameters object does not contain a valid curve and

NotSupportedException

The parameters/public key specified is not supported.

In this article
Back to top Generated by DocFX