verify Command¶
Verifies the signature of a RIM, CoRIM, or CoSWID tag.
Usage¶
rim verify -r <string> -i <file> [-p <file>] [-k <file>] [-l <path>] [-t <file>] [-d <payload-file>] [-e]
Parameters¶
| Parameter | Description | Required | Type |
|---|---|---|---|
-r, --rim-type |
Specifies the RIM type. | Yes | String |
-i, --in |
Specifies the input file to verify. | Yes | File |
-l, --rimel |
Support RIM (PC Client RIM only). See below. | No1 | Path |
-p, --public-certificate |
The signing certificate used to verify the RIM. | No2 | File |
-k, --public-key-file |
RSA PEM public key for PC Client RIMs, or JSON Web Key for COSE. | No2 | File |
-t, --truststore |
PEM CA certificates for validating embedded PC Client signing certificates.3 | No | File |
-d, --detached |
Reads the separate COSE payload; -i holds the signature envelope. |
No | File |
-e, --embed-cert |
Uses the embedded certificate for COSE verification.4 | No |
-l option (PC Client RIM only)¶
The default behavior for the verify command for a TCG PC Client RIM is to ignore the file attribute that specifies the name of the Support RIM file, as well as the hash associated with that file.
When verifying with a certificate (-p), this parameter enables verification of the Support RIM file's hash as follows:
-
-l "": uses the<Directory>element path (if present) associated with the corresponding<File>element to find the Support RIM. -
-l <path>: uses the supplied path, along with the file attribute, to find the Support RIM file.
PC Client verification with a public key alone (-k) checks only the XML signature; it does not check Support RIM hashes, even if -l is supplied.
Support RIM hash verification currently supports SHA-256 only.
Further Details
NISTIR 8060 , section 4.6.1 states:
Files are described using the
<File>element, and folders are described using the<Directory>element.
When processing a PC Client RIM with a certificate and -l "", the RIM-Tool combines the <Directory> element's location attribute (if present) with the <File> element's name attribute in the Base RIM's payload to locate the Support RIM.
See below Examples section for sample usage of the -l option.
Examples¶
Before Starting
Before running these examples, please ensure that you change into the data directory (requires installation):
Verify a TCG PC Client Base RIM, alongside Support RIM:
Verify a signed CoSWID tag:
Verify a signed CoRIM:
-
A Support RIM file is only used for a TCG PC Client RIM . See
-loption documentation. ↩ -
Provide
-por-k. For COSE,-ecan instead use an embedded certificate. For PC Client RIMs, use-kalone or the certificate path with-p; embedded certificates are processed automatically on that path. ↩↩ -
Required for certificate-chain validation when a PC Client RIM contains an embedded signing certificate. With no embedded certificate, verification uses the supplied key or certificate without checking a certificate chain. ↩
-
The embedded certificate supersedes
-p. It is checked against the protected-header thumbprint; this does not validate a certificate chain. ↩