Show / Hide Table of Contents

StoreData Method

StoreData(ReadOnlyMemory<byte>)

Stores data in the Security Domain or targeted Application on the YubiKey using the GlobalPlatform STORE DATA command.

C#
public void StoreData(ReadOnlyMemory<byte> data)

Parameters

Type Name Description
ReadOnlyMemory<byte> data

The data to be stored, which must be formatted as BER-TLV structures according to ISO 8825.

Exceptions

Type Condition
InvalidOperationException

Thrown when no secure connection is available or the security context is invalid.

SecureChannelException

Thrown when there was an SCP error, described in the exception message.

Remarks

The STORE DATA command is used to transfer data to either the Security Domain itself or to an Application being personalized. The data must be formatted as BER-TLV structures according to ISO 8825.

This implementation: - Uses a single block transfer (P1.b8=1 indicating last block) - Requires BER-TLV formatted data (P1.b5-b4=10) - Does not provide encryption information (P1.b7-b6=00)

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

The SecurityDomainSession makes use of this method to store data in the Security Domain. Such as the StoreCaIssuer(KeyReference, ReadOnlyMemory<byte>), StoreCertificates(KeyReference, IReadOnlyList<X509Certificate2>), StoreAllowlist(KeyReference, IReadOnlyCollection<string>), and other data.
In this article
Back to top Generated by DocFX