ykchalresp - Perform challenge-response operation with YubiKey
.SH SYNOPSIS
.B ykchalresp
-[\fI-1\fR | \fI-2\fR] [\fI-H\fR] [\fI-Y\fR] [\fI-N\fR] [\fI-x\fR] [\fI-v\fR] [\fI-h\fR]
+[\fI-1\fR | \fI-2\fR] [\fI-H\fR] [\fI-Y\fR] [\fI-N\fR] [\fI-x\fR] [\fI-v\fR] [\fI-V\fR] [\fI-h\fR]
.SH DESCRIPTION
.PP
Send a challenge to a YubiKey, and read the response. The YubiKey can be configured
.TP
\fB\-v\fR
enable verbose mode.
+.TP
+\fB\-V\fR
+print tool version and exit.
.SH EXAMPLE
The YubiKey challenge-response operation can be demonstrated using the
#include <ykdef.h>
#include <ykcore.h>
#include <ykstatus.h>
+#include <ykpers-version.h>
const char *usage =
"Usage: ykchalresp [options] challenge\n"
"\t-x Challenge is hex encoded.\n"
"\n"
"\t-v verbose\n"
+ "\t-V tool version\n"
"\t-h help (this text)\n"
"\n"
"\n"
;
-const char *optstring = "12xvhHYN";
+const char *optstring = "12xvhHYNV";
static void report_yk_error(void)
{
case 'v':
*verbose = true;
break;
+ case 'V':
+ fputs(YKPERS_VERSION_STRING "\n", stderr);
+ *exit_code = 0;
+ return 0;
case 'h':
default:
fputs(usage, stderr);
ykinfo - Get basic information from a YubiKey
.SH SYNOPSIS
.B ykinfo
-[\fI-s\fR] [\fI-m\fR] [\fI-H\fR] [\fI-v\fR] [\fI-t\fR] [\fI-p\fR] [\fI-q\fR] [\fI-h\fR]
+[\fI-s\fR] [\fI-m\fR] [\fI-H\fR] [\fI-v\fR] [\fI-t\fR] [\fI-p\fR] [\fI-q\fR] [\fI-V\fR] [\fI-h\fR]
.SH DESCRIPTION
.PP
Get basic information from a YubiKey. Can get serial number, version
\fB\-q\fR
modifier, only show the relevant data from the YubiKey, no extra information.
.TP
+\fB\-V\fR
+print tool version and exit
.SH EXAMPLE
Output of all information from a YubiKey
#include <yubikey.h>
#include <ykcore.h>
#include <ykstatus.h>
+#include <ykpers-version.h>
const char *usage =
"Usage: ykinfo [options]\n"
"\n"
"\t-q Only output information from YubiKey\n"
"\n"
+ "\t-V Get the tool version\n"
"\t-h help (this text)\n"
"\n"
"\n"
;
-const char *optstring = "asmHvtpqh";
+const char *optstring = "asmHvtpqhV";
static void report_yk_error(void)
{
case 'q':
*quiet = true;
break;
+ case 'V':
+ fputs(YKPERS_VERSION_STRING "\n", stderr);
+ *exit_code = 0;
+ return 0;
case 'h':
default:
fputs(usage, stderr);
#include <ykpers.h>
#include <yubikey.h> /* To get yubikey_modhex_encode and yubikey_hex_encode */
#include <ykdef.h>
+#include <ykpers-version.h>
#include "ykpers-args.h"
#define YUBICO_OATH_VENDOR_ID_HEX 0xe1 /* UB as hex */
"-d dry-run (don't write anything to key)\n"
"\n"
"-v verbose\n"
+"-V tool version\n"
"-h help (this text)\n"
;
-const char *optstring = "u12xza:c:n:t:hi:o:s:f:dvym:S::";
+const char *optstring = "u12xza:c:n:t:hi:o:s:f:dvym:S::V";
static int _set_fixed(char *opt, YKP_CONFIG *cfg);
static int _format_decimal_as_hex(uint8_t *dst, size_t dst_len, uint8_t *src);
case 'y':
*autocommit = true;
break;
+ case 'V':
+ fputs(YKPERS_VERSION_STRING "\n", stderr);
+ *exit_code = 0;
+ return 0;
case 'h':
default:
fputs(usage, stderr);
.B ykpersonalize
[\fI-1\fR | \fI-2\fR] [\fI-sfile\fR] [\fI-ifile\fR] [\fI-fformat\fR] [\fI-axxx\fR] [\fI-cxxx\fR]
[\fI-ooption\fR] [\fI-y\fR] [\fI-v\fR] [\fI-d\fR] [\fI-h\fR] [\fI-n\fR] [\fI-t\fR] [\fI-u\fR] [\fI-x\fR]
-[\fI-z\fR] [\fI-m\fR] [\fI-S\fR]
+[\fI-z\fR] [\fI-m\fR] [\fI-S\fR] [\fI-V\fR]
.\".SH DESCRIPTION
.\" Add any additional description here
.SH OPTIONS
\fB-h\fR
Help
.TP
+\fB-V\fR
+Version
+.TP
\fBYubiKey NEO only\fR
.RS
.TP