ChangeReferenceDataCommand Constructor
ChangeReferenceDataCommand(Byte, ReadOnlyMemory<Byte>, ReadOnlyMemory<Byte>)
Build a new Command object to "change reference data", which means to change a PIN or PUK.
public ChangeReferenceDataCommand(byte slotNumber, ReadOnlyMemory<byte> currentValue, ReadOnlyMemory<byte> newValue)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | slotNumber | Which element to change, the PIN or PUK. Use |
System.ReadOnlyMemory<System.Byte> | currentValue | The current PIN or PUK, the value to change. |
System.ReadOnlyMemory<System.Byte> | newValue | The new PIN or PUK. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | The PIN or PUK is an incorrect length. |
Remarks
In order to change a PIN or PUK, the caller must supply the old and
new PIN or PUK. In this class, the PINs and PUKs are supplied as
ReadOnlyMemory<byte>
. It is possible to pass a
byte[]
, because it will be automatically cast.
This class will copy references to the PINs and PUKs (not the values).
This means that you can overwrite the PIN or PUK in your byte array
only after this class is done with it. It will no longer need the PIN
or PUK after calling connection.SendCommand
.
The PIN and PUK are both allowed to be 6 to 8 characters/bytes. The PIN can be any ASCII character. For YubiKeys with firmware versions prior to 5.7, the PUK is allowed to be any character in the 0x00
- 0xFF
range for a total length of 6-8 bytes. For YubiKeys with firmware version 5.7 and above, the PUK is allowed to be any character in the 0x00
- 0x7F
range for a total length of 6-8 Unicode code points.