Show / Hide Table of Contents

ChangeManagementKey Method

ChangeManagementKey(PivTouchPolicy)

Change the management key, throw an exception if the user cancels. The default management key algorithm will be used. (Firmware 5.7.x and later: AES-192. Firmware 5.6.x and earlier: TDES.)

C#
public void ChangeManagementKey(PivTouchPolicy touchPolicy = PivTouchPolicy.Default)

Parameters

Type Name Description
PivTouchPolicy touchPolicy

Exceptions

Type Condition
InvalidOperationException

There is no KeyCollector loaded, the key provided was not a valid Triple-DES or AES key, 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.

Remarks

This is the same as TryChangeManagementKey(PivTouchPolicy), except this method will throw an exception if the KeyCollector indicates user cancellation.

See the TryChangeManagementKey(PivTouchPolicy) method for further documentation on this method.

ChangeManagementKey(PivTouchPolicy, PivAlgorithm)

Change the management key, throw an exception if the user cancels. The new key will be of the specified algorithm.

C#
public void ChangeManagementKey(PivTouchPolicy touchPolicy, PivAlgorithm newKeyAlgorithm)

Parameters

Type Name Description
PivTouchPolicy touchPolicy
PivAlgorithm newKeyAlgorithm

Exceptions

Type Condition
InvalidOperationException

There is no KeyCollector loaded, the key provided was not a valid Triple-DES or AES key, 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.

Remarks

This is the same as TryChangeManagementKey(PivTouchPolicy,PivAlgorithm), except this method will throw an exception if the KeyCollecter indicates user cancellation.

See the TryChangeManagementKey(PivTouchPolicy, PivAlgorithm) method for further documentation on this method.

In this article
Back to top Generated by DocFX