Show / Hide Table of Contents

SecurityDomainSession Constructor

SecurityDomainSession(IYubiKeyDevice)

Create an unauthenticated instance of SecurityDomainSession, the object that manages the security domain on the YubiKey.

C#
public SecurityDomainSession(IYubiKeyDevice yubiKey)

Parameters

Type Name Description
IYubiKeyDevice yubiKey

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

Exceptions

Type Condition
ArgumentNullException

The yubiKey argument is null.

Remarks

Sessions created from this constructor will not be able to perform operations which require authentication

See GlobalPlatform Technology Card Specification v2.3.1 §11 APDU Command Reference for more information.

SecurityDomainSession(IYubiKeyDevice, ScpKeyParameters)

Create an instance of SecurityDomainSession, the object that manages the security domain on the YubiKey.

C#
public SecurityDomainSession(IYubiKeyDevice yubiKey, ScpKeyParameters scpKeyParameters)

Parameters

Type Name Description
IYubiKeyDevice yubiKey

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

ScpKeyParameters scpKeyParameters

The shared secret keys that will be used to authenticate the caller and encrypt the communications.

Exceptions

Type Condition
ArgumentNullException

The yubiKey or scpKeys argument is null.

Remarks

See the User's Manual entry on SCP.

See GlobalPlatform Technology Card Specification v2.3.1 §11 APDU Command Reference for more information on SCP.

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

if (YubiKeyDevice.TryGetYubiKey(serialNumber, out IYubiKeyDevice yubiKeyDevice))
{
    using (var scp = new SecurityDomainSession(yubiKeyDevice, Scp03KeyParameters.DefaultKey))
    {
        // Perform SCP operations while authenticated with SCP03
    }
}
In this article
Back to top Generated by DocFX