== Read/Write Objects
    yubico-piv-tool -a read-object --id <object ID> [ -o <output file> -f <file format> ]
    yubico-piv-tool -a write-object --id <object ID> -k [ -i <input file>  -f <file format>]

=== Description
Reads and stores raw data into a PIV slot. The form and ID of the data are detailed in the
link:https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-73-4.pdf[PIV Specification SP 800-73-4].

Writting an object is an action that requires authentication, which is done by providing the management key.
If no management key is provided, the tool will try to authenticate using the default management key.
footnote:[It is strongly recommended to change the Yubikey's PIN, PUK and management key before start using it.]

=== Supported PIV Object IDs

|===================================
|Type of Object Data                            | ASN.1 OID                     | ID

|Card Capability Container                      | 2.16.840.1.101.3.7.1.219.0    | 0x5fc107
|Card Holder Unique Identifier                  | 2.16.840.1.101.3.7.2.48.0     | 0x5fc102
|X.509 Certificate for PIV Authentication       | 2.16.840.1.101.3.7.2.1.1      | 0x5fc105
|Cardholder Fingerprints                        | 2.16.840.1.101.3.7.2.96.16    | 0x5fc103
|Security Object                                | 2.16.840.1.101.3.7.2.144.0    | 0x5fc106
|Cardholder Facial Image                        | 2.16.840.1.101.3.7.2.96.48    | 0x5fc108
|X.509 Certificate for Card Authentication      | 2.16.840.1.101.3.7.2.5.0      | 0x5fc101
|X.509 Certificate for Digital Signature        | 2.16.840.1.101.3.7.2.1.0      | 0x5fc10a
|X.509 Certificate for Key Management           | 2.16.840.1.101.3.7.2.1.2      | 0x5fc10b
|Printed Information                            | 2.16.840.1.101.3.7.2.48.1     | 0x5fc109
|Discovery Object                               | 2.16.840.1.101.3.7.2.96.80    | 0x7e
|Key History Object                             | 2.16.840.1.101.3.7.2.96.96    | 0x5fc10c
|Retired X.509 Certificate for Key Management   | 12.16.840.1.101.3.7.2.16.1    | 0x5fc10d
|Retired X.509 Certificate for Key Management   | 22.16.840.1.101.3.7.2.16.2    | 0x5fc10e
|Retired X.509 Certificate for Key Management   | 32.16.840.1.101.3.7.2.16.3    | 0x5fc10f
|Retired X.509 Certificate for Key Management   | 42.16.840.1.101.3.7.2.16.4    | 0x5fc110
|Retired X.509 Certificate for Key Management   | 52.16.840.1.101.3.7.2.16.5    | 0x5fc111
|Retired X.509 Certificate for Key Management   | 62.16.840.1.101.3.7.2.16.6    | 0x5fc112
|Retired X.509 Certificate for Key Management   | 72.16.840.1.101.3.7.2.16.7    | 0x5fc113
|Retired X.509 Certificate for Key Management   | 82.16.840.1.101.3.7.2.16.8    | 0x5fc114
|Retired X.509 Certificate for Key Management   | 92.16.840.1.101.3.7.2.16.9    | 0x5fc115
|Retired X.509 Certificate for Key Management   | 102.16.840.1.101.3.7.2.16.10  | 0x5fc116
|Retired X.509 Certificate for Key Management   | 112.16.840.1.101.3.7.2.16.11  | 0x5fc117
|Retired X.509 Certificate for Key Management   | 122.16.840.1.101.3.7.2.16.12  | 0x5fc118
|Retired X.509 Certificate for Key Management   | 132.16.840.1.101.3.7.2.16.13  | 0x5fc119
|Retired X.509 Certificate for Key Management   | 142.16.840.1.101.3.7.2.16.14  | 0x5fc11a
|Retired X.509 Certificate for Key Management   | 152.16.840.1.101.3.7.2.16.15  | 0x5fc11b
|Retired X.509 Certificate for Key Management   | 162.16.840.1.101.3.7.2.16.16  | 0x5fc11c
|Retired X.509 Certificate for Key Management   | 172.16.840.1.101.3.7.2.16.17  | 0x5fc11d
|Retired X.509 Certificate for Key Management   | 182.16.840.1.101.3.7.2.16.18  | 0x5fc11e
|Retired X.509 Certificate for Key Management   | 192.16.840.1.101.3.7.2.16.19  | 0x5fc11f
|Retired X.509 Certificate for Key Management   | 202.16.840.1.101.3.7.2.16.20  | 0x5fc120
|Cardholder Iris Images                         | 2.16.840.1.101.3.7.2.16.21    | 0x5fc121
|===================================


=== Parameters

|===================================
|Parameter          | Required | Optional | Description | Possible values | Default value

|--id               | X | | The ID of the object to write/read according to PIV Specifications  | |
|-k, --key          | X | | Management key to use, if no value is specified key will be asked for | | 010203040506070801020304050607080102030405060708
|-i, --input        | | X | Filename to use as input. If left out, input will be read from Stdin | None or file name | Stdin
|-o, --output       | | X | Filename to use as output. If left out, output will be printed to Stdout | None or file name | Stdout
|-f, --format       | | X | Format of data for write/read object | hex, base64, binary | hex
|===================================

=== Examples
    $ yubico-piv-tool -a read-object --id 0x5fc10d
     
