PivDataObject Class
Namespace: Yubico.YubiKey.Piv.Objects Assembly: Yubico.YubiKey.dllThis abstract class defines the basic properties of a PIV Application Data Object.
public abstract class PivDataObject : Object, IDisposable
Implements
Remarks
Generally you will use one of the ReadObject<T>() methods to get the specified data out of a YubiKey. The formatted data will be parsed and the resulting object will present the data in a more readable form. You can then update the data and call WriteObject(PivDataObject).
Note that if there is no data on the YubiKey stored under the given
object, then after calling ReadObject
, the resulting
PivDataObject
will be "empty" (IsEmpty)
You can also create a new instance of a PivDataObject
(call the
constructor directly, rather than getting the YubiKey's contents), set
it, and store it. However, when you store data (by calling
WriteObject
), you overwrite any data already there. Hence, you
will likely want to get any data out first, to decide whether you want to
change anything, rather than overwriting any possible contents sight
unseen.
This class (and each subclass) implements IDisposable
because the
data might be sensitive. Upon disposal, any stored data is overwritten.
See also the user's manual entry on PIV data objects.
Constructors
Name | Description |
---|---|
PivDataObject() |
Properties
Name | Description |
---|---|
DataTag | The value used to specify the storage location. |
IsEmpty | Indicates whether there is any data or not. If this is true, then the contents of any property are meaningless. |
Methods
Name | Description |
---|---|
Decode(ReadOnlyMemory<Byte>) | Decode the data given according to the format specified for the data object. |
Dispose() | Releases any unmanaged resources and overwrites any sensitive data. |
Dispose(Boolean) | Releases any unmanaged resources and overwrites any sensitive data. |
Encode() | Build the encoding of the data. |
GetDefinedDataTag() | Get the defined data tag. This is the data tag that the PIV standard or Yubico defines to specify the given data object. |
IsValidAlternateTag(Int32) | Is the given tag valid as an alternate? |
TryDecode(ReadOnlyMemory<Byte>) | Try to decode the data given according to the format specified for
the data object. If successful, return |