Show / Hide Table of Contents

Scp03Session Constructor

Scp03Session(IYubiKeyDevice, StaticKeys)

Create an instance of Scp03Session, the object that represents SCP03 on the YubiKey.

C#
public Scp03Session(IYubiKeyDevice yubiKey, StaticKeys scp03Keys)

Parameters

Type Name Description
IYubiKeyDevice yubiKey

The object that represents the actual YubiKey which will perform the operations.

StaticKeys scp03Keys

The shared secret keys that will be used to authenticate the caller and encrypt the communications. This constructor will make a deep copy of the keys, it will not copy a reference to the object.

Exceptions

Type Condition
ArgumentNullException

The yubiKey or scp03Keys argument is null.

Remarks

See the User's Manual entry on SCP03.

Because this class implements IDisposable, use the using keyword. For example,

if (YubiKeyDevice.TryGetYubiKey(serialNumber, out IYubiKeyDevice yubiKeyDevice))
{
    var staticKeys = new StaticKeys();
    // Note that you do not need to call the "WithScp03" method when
    // using the Scp03Session class.
    using (var scp03 = new Scp03Session(yubiKeyDevice, staticKeys))
    {
        // Perform SCP03 operations.
    }
}
In this article
Back to top Generated by DocFX