Show / Hide Table of Contents

MoveKey Method

MoveKey(byte, byte)

Moves a key from one slot to another. The source slot must not be the Attestation-slot and the destination slot must be empty. Any key except the attestation key can be moved from one slot to another.

C#
public void MoveKey(byte sourceSlot, byte destinationSlot)

Parameters

Type Name Description
byte sourceSlot

The Yubikey slot of the key you want to move. This must be a valid slot number.

byte destinationSlot

The target Yubikey slot for the key you want to move. This must be a valid slot number.

Exceptions

Type Condition
InvalidOperationException

There is no KeyCollector loaded, the key provided was not a valid key, the slot contained an attestation key, the or the YubiKey had some other error, such as unreliable connection.

MalformedYubiKeyResponseException

The YubiKey returned malformed data and authentication, either single or double, could not be performed.

OperationCanceledException

The user canceled management key collection.

SecurityException

Mutual authentication was performed and the YubiKey was not authenticated.

NotSupportedException

Thrown when the Yubikey doesn't support the Move-operation.

Remarks

Internally this method attempts to authenticate to the Yubikey by calling AuthenticateManagementKey(bool) which may in turn throw its' own exceptions.

In this article
Back to top Generated by DocFX