Show / Hide Table of Contents

AuthenticateKeyAgreeCommand Constructor

AuthenticateKeyAgreeCommand(ReadOnlyMemory<byte>, byte)

Initializes a new instance of the AuthenticateKeyAgreeCommand class. This command takes the slot number and the corresponding party's public key.

C#
[Obsolete("Use the constructor with the algorithm parameter instead.", false)]
public AuthenticateKeyAgreeCommand(ReadOnlyMemory<byte> correspondentPublicKey, byte slotNumber)

Parameters

Type Name Description
ReadOnlyMemory<byte> correspondentPublicKey

The public key that will be used to perform phase 2 of ECDH.

byte slotNumber

The slot holding the private key to use.

Exceptions

Type Condition
ArgumentException

The correspondent public value is not the correct length.

Remarks

The slot number must be for a slot that holds an ECC private key. It cannot be F9 (the attestation key).

If the key that will be used to perform key agreement is ECC-P256, then the correspondent public key data must be 65 bytes long. If the key is ECC-P384, then the data must be 97 bytes long. See also the User's Manual entry on key agreement in the PIV commands page.

AuthenticateKeyAgreeCommand(ReadOnlyMemory<byte>, byte, PivAlgorithm)

Initializes a new instance of the AuthenticateKeyAgreeCommand class. This command takes the slot number and the corresponding party's public key.

C#
public AuthenticateKeyAgreeCommand(ReadOnlyMemory<byte> correspondentPublicKey, byte slotNumber, PivAlgorithm algorithm)

Parameters

Type Name Description
ReadOnlyMemory<byte> correspondentPublicKey

The public key that will be used to perform phase 2 of ECDH.

byte slotNumber

The slot holding the private key to use.

PivAlgorithm algorithm

Exceptions

Type Condition
ArgumentException

The correspondent public value is not the correct length.

Remarks

The slot number must be for a slot that holds an ECC private key. It cannot be F9 (the attestation key).

If the key that will be used to perform key agreement is ECC-P256, then the correspondent public key data must be 65 bytes long. If the key is ECC-P384, then the data must be 97 bytes long. See also the User's Manual entry on key agreement in the PIV commands page.

In this article
Back to top Generated by DocFX