CardCapabilityContainer ClassNamespace: Yubico.YubiKey.Piv.Objects Assembly: Yubico.YubiKey.dll
Use this class to process the CCC (Card Capability Container) data.
public sealed class CardCapabilityContainer : PivDataObject, IDisposable
The PIV standard declares,
"The Card Capability Container (CCC) is a mandatory data object whose purpose is to facilitate compatibility of Government Smart Card Interoperability Specification (GSC-IS) applications with PIV Cards."
In other words, it's a holdover from the older smart card specification. In order to remain compatible with that older spec and with older applications, it might be necessary to read and write this data object.
There are many elements that make up the CCC, but most of them are ignored by PIV and the YubiKey. Other elements are fixed. Note that the PIV standard says,
"The data model of the PIV Card Application shall be identified by data model number 0x10. ... The content of the CCC data elements, other than the data model number, are out of scope for this specification."
There is only one element that can be set in this class, namely, the Card Identifier portion of the Unique Card Identifier. This is a 14-byte value. With the YubiKey, the caller sets it, or allows the SDK to set it to random bytes.
Upon manufacture, the CCC is "empty", so the
IsEmpty property is
true. This object will
be considered empty until the Card Identifier is set. See
SetCardId(ReadOnlySpan<Byte>) and SetRandomCardId().
The following list indicates the elements of the CCC that can be found on a YubiKey.
- Unique Card Identifier
- Application Identifier (part of the Unique Card ID
- GSC-RID (Registered Application Provider Identifier, part of the AID)
- Card Identifier (part of the Unique Card ID)
- Manufacturer ID
- Card Type
- Container Version Number
- Grammar Version Number
- PKCS #15 Version Number (for the YubiKey, this is 0x00 indicating PKCS #15 is not supported
- Data Model Number
Build a new object. This will not get the CCC from from any YubiKey, it will only build an "empty" object.
The "AID" (Capabilities Application Identifier), which consists of the GSC-RID || ManufacturerID || CardType.
The actual Card Identifier portion of the Unique Card Identifier.
The card type is fixed at JavaCard.
The version number of the CCC itself, it is fixed at version 2.1.
The number representing the Data Model used by the smart card. For the YubiKey it is fixed at 0x10 (a PIV requirement).
The version number of the CCC grammar, it is fixed at version 2.1.
The "Government Smart Card - Registered Application Provider Identifier".
The manufacturer ID is fixed at 0xFF
The version of PKCS #15 the card supports. If the card does not support PKCS #15, this number is 0x00. For the YubiKey it is fixed at 0x00.
The full Unique Card Identifier which consists of the AID || CardID.
Releases any unmanaged resources and overwrites any sensitive data.
Build the encoding of the data.
Get the defined data tag. This is the data tag that the PIV standard or Yubico defines to specify the given data object.
Set the CardId with a random, 14-byte value.
Try to decode the data given according to the format specified for
the data object. If successful, return