xref: /freebsd/contrib/libfido2/man/fido2-cred.1 (revision 60a517b66a69b8c011b04063ef63a938738719bd)
1*60a517b6SEd Maste.\" Copyright (c) 2018-2023 Yubico AB. All rights reserved.
22ccfa855SEd Maste.\"
32ccfa855SEd Maste.\" Redistribution and use in source and binary forms, with or without
42ccfa855SEd Maste.\" modification, are permitted provided that the following conditions are
52ccfa855SEd Maste.\" met:
62ccfa855SEd Maste.\"
72ccfa855SEd Maste.\"    1. Redistributions of source code must retain the above copyright
82ccfa855SEd Maste.\"       notice, this list of conditions and the following disclaimer.
92ccfa855SEd Maste.\"    2. Redistributions in binary form must reproduce the above copyright
102ccfa855SEd Maste.\"       notice, this list of conditions and the following disclaimer in
112ccfa855SEd Maste.\"       the documentation and/or other materials provided with the
122ccfa855SEd Maste.\"       distribution.
132ccfa855SEd Maste.\"
142ccfa855SEd Maste.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
152ccfa855SEd Maste.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
162ccfa855SEd Maste.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
172ccfa855SEd Maste.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
182ccfa855SEd Maste.\" HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
192ccfa855SEd Maste.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
202ccfa855SEd Maste.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
212ccfa855SEd Maste.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
222ccfa855SEd Maste.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
232ccfa855SEd Maste.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
242ccfa855SEd Maste.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
252ccfa855SEd Maste.\"
262ccfa855SEd Maste.\" SPDX-License-Identifier: BSD-2-Clause
270afa8e06SEd Maste.\"
28*60a517b6SEd Maste.Dd $Mdocdate: July 3 2023 $
290afa8e06SEd Maste.Dt FIDO2-CRED 1
300afa8e06SEd Maste.Os
310afa8e06SEd Maste.Sh NAME
320afa8e06SEd Maste.Nm fido2-cred
330afa8e06SEd Maste.Nd make/verify a FIDO2 credential
340afa8e06SEd Maste.Sh SYNOPSIS
350afa8e06SEd Maste.Nm
360afa8e06SEd Maste.Fl M
37*60a517b6SEd Maste.Op Fl bdhqruvw
380afa8e06SEd Maste.Op Fl c Ar cred_protect
390afa8e06SEd Maste.Op Fl i Ar input_file
400afa8e06SEd Maste.Op Fl o Ar output_file
410afa8e06SEd Maste.Ar device
420afa8e06SEd Maste.Op Ar type
430afa8e06SEd Maste.Nm
440afa8e06SEd Maste.Fl V
450afa8e06SEd Maste.Op Fl dhv
460afa8e06SEd Maste.Op Fl c Ar cred_protect
470afa8e06SEd Maste.Op Fl i Ar input_file
480afa8e06SEd Maste.Op Fl o Ar output_file
490afa8e06SEd Maste.Op Ar type
500afa8e06SEd Maste.Sh DESCRIPTION
510afa8e06SEd Maste.Nm
520afa8e06SEd Mastemakes or verifies a FIDO2 credential.
530afa8e06SEd Maste.Pp
540afa8e06SEd MasteA credential
550afa8e06SEd Maste.Ar type
560afa8e06SEd Mastemay be
570afa8e06SEd Maste.Em es256
580afa8e06SEd Maste(denoting ECDSA over NIST P-256 with SHA-256),
590afa8e06SEd Maste.Em rs256
600afa8e06SEd Maste(denoting 2048-bit RSA with PKCS#1.5 padding and SHA-256), or
610afa8e06SEd Maste.Em eddsa
620afa8e06SEd Maste(denoting EDDSA over Curve25519 with SHA-512).
630afa8e06SEd MasteIf
640afa8e06SEd Maste.Ar type
650afa8e06SEd Masteis not specified,
660afa8e06SEd Maste.Em es256
670afa8e06SEd Masteis assumed.
680afa8e06SEd Maste.Pp
690afa8e06SEd MasteWhen making a credential, the authenticator may require the user
700afa8e06SEd Masteto authenticate with a PIN.
710afa8e06SEd MasteIf the
720afa8e06SEd Maste.Fl q
730afa8e06SEd Masteoption is not specified,
740afa8e06SEd Maste.Nm
750afa8e06SEd Mastewill prompt the user for the PIN.
760afa8e06SEd MasteIf a
770afa8e06SEd Maste.Em tty
780afa8e06SEd Masteis available,
790afa8e06SEd Maste.Nm
800afa8e06SEd Mastewill use it to obtain the PIN.
810afa8e06SEd MasteOtherwise,
820afa8e06SEd Maste.Em stdin
830afa8e06SEd Masteis used.
840afa8e06SEd Maste.Pp
850afa8e06SEd MasteThe input of
860afa8e06SEd Maste.Nm
870afa8e06SEd Masteis defined by the parameters of the credential to be made/verified.
880afa8e06SEd MasteSee the
890afa8e06SEd Maste.Sx INPUT FORMAT
900afa8e06SEd Mastesection for details.
910afa8e06SEd Maste.Pp
920afa8e06SEd MasteThe output of
930afa8e06SEd Maste.Nm
940afa8e06SEd Masteis defined by the result of the selected operation.
950afa8e06SEd MasteSee the
960afa8e06SEd Maste.Sx OUTPUT FORMAT
970afa8e06SEd Mastesection for details.
980afa8e06SEd Maste.Pp
990afa8e06SEd MasteIf a credential is successfully created or verified,
1000afa8e06SEd Maste.Nm
1010afa8e06SEd Masteexits 0.
1020afa8e06SEd MasteOtherwise,
1030afa8e06SEd Maste.Nm
1040afa8e06SEd Masteexits 1.
1050afa8e06SEd Maste.Pp
1060afa8e06SEd MasteThe options are as follows:
1070afa8e06SEd Maste.Bl -tag -width Ds
1080afa8e06SEd Maste.It Fl M
1090afa8e06SEd MasteTells
1100afa8e06SEd Maste.Nm
1110afa8e06SEd Masteto make a new credential on
1120afa8e06SEd Maste.Ar device .
1130afa8e06SEd Maste.It Fl V
1140afa8e06SEd MasteTells
1150afa8e06SEd Maste.Nm
1160afa8e06SEd Masteto verify a credential.
1170afa8e06SEd Maste.It Fl b
1180afa8e06SEd MasteRequest the credential's
1190afa8e06SEd Maste.Dq largeBlobKey ,
1200afa8e06SEd Mastea 32-byte symmetric key associated with the generated credential.
1210afa8e06SEd Maste.It Fl c Ar cred_protect
1220afa8e06SEd MasteIf making a credential, set the credential's protection level to
1230afa8e06SEd Maste.Ar cred_protect ,
1240afa8e06SEd Mastewhere
1250afa8e06SEd Maste.Ar cred_protect
1260afa8e06SEd Masteis the credential's protection level in decimal notation.
1270afa8e06SEd MastePlease refer to
1280afa8e06SEd Maste.In fido/param.h
1290afa8e06SEd Mastefor the set of possible values.
1300afa8e06SEd MasteIf verifying a credential, check whether the credential's protection
1310afa8e06SEd Mastelevel was signed by the authenticator as
1320afa8e06SEd Maste.Ar cred_protect .
1330afa8e06SEd Maste.It Fl d
1340afa8e06SEd MasteCauses
1350afa8e06SEd Maste.Nm
1360afa8e06SEd Masteto emit debugging output on
1370afa8e06SEd Maste.Em stderr .
1380afa8e06SEd Maste.It Fl h
1390afa8e06SEd MasteIf making a credential, enable the FIDO2 hmac-secret extension.
1400afa8e06SEd MasteIf verifying a credential, check whether the extension data bit was
1410afa8e06SEd Mastesigned by the authenticator.
1420afa8e06SEd Maste.It Fl i Ar input_file
1430afa8e06SEd MasteTells
1440afa8e06SEd Maste.Nm
1450afa8e06SEd Masteto read the parameters of the credential from
1460afa8e06SEd Maste.Ar input_file
1470afa8e06SEd Masteinstead of
1480afa8e06SEd Maste.Em stdin .
1490afa8e06SEd Maste.It Fl o Ar output_file
1500afa8e06SEd MasteTells
1510afa8e06SEd Maste.Nm
1520afa8e06SEd Masteto write output on
1530afa8e06SEd Maste.Ar output_file
1540afa8e06SEd Masteinstead of
1550afa8e06SEd Maste.Em stdout .
1560afa8e06SEd Maste.It Fl q
1570afa8e06SEd MasteTells
1580afa8e06SEd Maste.Nm
1590afa8e06SEd Masteto be quiet.
1600afa8e06SEd MasteIf a PIN is required and
1610afa8e06SEd Maste.Fl q
1620afa8e06SEd Masteis specified,
1630afa8e06SEd Maste.Nm
1640afa8e06SEd Mastewill fail.
1650afa8e06SEd Maste.It Fl r
1660afa8e06SEd MasteCreate a resident credential.
1670afa8e06SEd MasteResident credentials are called
1680afa8e06SEd Maste.Dq discoverable credentials
1693e696dfbSEd Mastein CTAP 2.1.
1700afa8e06SEd Maste.It Fl u
1710afa8e06SEd MasteCreate a U2F credential.
1720afa8e06SEd MasteBy default,
1730afa8e06SEd Maste.Nm
1740afa8e06SEd Mastewill use FIDO2 if supported by the authenticator, and fallback to
1750afa8e06SEd MasteU2F otherwise.
1760afa8e06SEd Maste.It Fl v
1770afa8e06SEd MasteIf making a credential, request user verification.
1780afa8e06SEd MasteIf verifying a credential, check whether the user verification bit
1790afa8e06SEd Mastewas signed by the authenticator.
180*60a517b6SEd Maste.It Fl w
181*60a517b6SEd MasteTells
182*60a517b6SEd Maste.Nm
183*60a517b6SEd Mastethat the first line of input when making a credential shall be
184*60a517b6SEd Masteinterpreted as unhashed client data.
185*60a517b6SEd MasteThis is required by Windows Hello, which calculates the client data hash
186*60a517b6SEd Masteinternally.
1870afa8e06SEd Maste.El
1880afa8e06SEd Maste.Sh INPUT FORMAT
1890afa8e06SEd MasteThe input of
1900afa8e06SEd Maste.Nm
1910afa8e06SEd Masteconsists of base64 blobs and UTF-8 strings separated
1920afa8e06SEd Masteby newline characters ('\\n').
1930afa8e06SEd Maste.Pp
1940afa8e06SEd MasteWhen making a credential,
1950afa8e06SEd Maste.Nm
1960afa8e06SEd Masteexpects its input to consist of:
1970afa8e06SEd Maste.Pp
1980afa8e06SEd Maste.Bl -enum -offset indent -compact
1990afa8e06SEd Maste.It
2000afa8e06SEd Masteclient data hash (base64 blob);
2010afa8e06SEd Maste.It
2020afa8e06SEd Masterelying party id (UTF-8 string);
2030afa8e06SEd Maste.It
2040afa8e06SEd Masteuser name (UTF-8 string);
2050afa8e06SEd Maste.It
2060afa8e06SEd Masteuser id (base64 blob).
2070afa8e06SEd Maste.El
2080afa8e06SEd Maste.Pp
2090afa8e06SEd MasteWhen verifying a credential,
2100afa8e06SEd Maste.Nm
2110afa8e06SEd Masteexpects its input to consist of:
2120afa8e06SEd Maste.Pp
2130afa8e06SEd Maste.Bl -enum -offset indent -compact
2140afa8e06SEd Maste.It
2150afa8e06SEd Masteclient data hash (base64 blob);
2160afa8e06SEd Maste.It
2170afa8e06SEd Masterelying party id (UTF-8 string);
2180afa8e06SEd Maste.It
2190afa8e06SEd Mastecredential format (UTF-8 string);
2200afa8e06SEd Maste.It
2210afa8e06SEd Masteauthenticator data (base64 blob);
2220afa8e06SEd Maste.It
2230afa8e06SEd Mastecredential id (base64 blob);
2240afa8e06SEd Maste.It
2250afa8e06SEd Masteattestation signature (base64 blob);
2260afa8e06SEd Maste.It
2270afa8e06SEd Masteattestation certificate (optional, base64 blob).
2280afa8e06SEd Maste.El
2290afa8e06SEd Maste.Pp
2300afa8e06SEd MasteUTF-8 strings passed to
2310afa8e06SEd Maste.Nm
2320afa8e06SEd Mastemust not contain embedded newline or NUL characters.
2330afa8e06SEd Maste.Sh OUTPUT FORMAT
2340afa8e06SEd MasteThe output of
2350afa8e06SEd Maste.Nm
2360afa8e06SEd Masteconsists of base64 blobs, UTF-8 strings, and PEM-encoded public
2370afa8e06SEd Mastekeys separated by newline characters ('\\n').
2380afa8e06SEd Maste.Pp
2390afa8e06SEd MasteUpon the successful generation of a credential,
2400afa8e06SEd Maste.Nm
2410afa8e06SEd Masteoutputs:
2420afa8e06SEd Maste.Pp
2430afa8e06SEd Maste.Bl -enum -offset indent -compact
2440afa8e06SEd Maste.It
2450afa8e06SEd Masteclient data hash (base64 blob);
2460afa8e06SEd Maste.It
2470afa8e06SEd Masterelying party id (UTF-8 string);
2480afa8e06SEd Maste.It
2490afa8e06SEd Mastecredential format (UTF-8 string);
2500afa8e06SEd Maste.It
2510afa8e06SEd Masteauthenticator data (base64 blob);
2520afa8e06SEd Maste.It
2530afa8e06SEd Mastecredential id (base64 blob);
2540afa8e06SEd Maste.It
2550afa8e06SEd Masteattestation signature (base64 blob);
2560afa8e06SEd Maste.It
2570afa8e06SEd Masteattestation certificate, if present (base64 blob).
2580afa8e06SEd Maste.It
2590afa8e06SEd Mastethe credential's associated 32-byte symmetric key
2600afa8e06SEd Maste.Pq Dq largeBlobKey ,
2610afa8e06SEd Masteif present (base64 blob).
2620afa8e06SEd Maste.El
2630afa8e06SEd Maste.Pp
2640afa8e06SEd MasteUpon the successful verification of a credential,
2650afa8e06SEd Maste.Nm
2660afa8e06SEd Masteoutputs:
2670afa8e06SEd Maste.Pp
2680afa8e06SEd Maste.Bl -enum -offset indent -compact
2690afa8e06SEd Maste.It
2700afa8e06SEd Mastecredential id (base64 blob);
2710afa8e06SEd Maste.It
2720afa8e06SEd MastePEM-encoded credential key.
2730afa8e06SEd Maste.El
2740afa8e06SEd Maste.Sh EXAMPLES
2750afa8e06SEd MasteCreate a new
2760afa8e06SEd Maste.Em es256
2770afa8e06SEd Mastecredential on
2780afa8e06SEd Maste.Pa /dev/hidraw5 ,
2790afa8e06SEd Masteverify it, and save the id and the public key of the credential in
2800afa8e06SEd Maste.Em cred :
2810afa8e06SEd Maste.Pp
2820afa8e06SEd Maste.Dl $ echo credential challenge | openssl sha256 -binary | base64 > cred_param
2830afa8e06SEd Maste.Dl $ echo relying party >> cred_param
2840afa8e06SEd Maste.Dl $ echo user name >> cred_param
2850afa8e06SEd Maste.Dl $ dd if=/dev/urandom bs=1 count=32 | base64 >> cred_param
2860afa8e06SEd Maste.Dl $ fido2-cred -M -i cred_param /dev/hidraw5 | fido2-cred -V -o cred
2870afa8e06SEd Maste.Sh SEE ALSO
2880afa8e06SEd Maste.Xr fido2-assert 1 ,
2890afa8e06SEd Maste.Xr fido2-token 1
2900afa8e06SEd Maste.Sh CAVEATS
2910afa8e06SEd MastePlease note that
2920afa8e06SEd Maste.Nm
2930afa8e06SEd Mastehandles Basic Attestation and Self Attestation transparently.
2940afa8e06SEd MasteIn the case of Basic Attestation, the validity of the authenticator's
2950afa8e06SEd Masteattestation certificate is
2960afa8e06SEd Maste.Em not
2970afa8e06SEd Masteverified.
298