From cfd597c60356d6d5415738b01004b3d86164fa7a Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 4 Apr 2025 16:08:35 +0200 Subject: gpg: New key generation parameter "User-Id". * g10/keygen.c (read_parameter_file): Add keyword "User-Id". --- doc/gpg.texi | 12 +++++++----- g10/keygen.c | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/doc/gpg.texi b/doc/gpg.texi index cd979b2a5..546dbf080 100644 --- a/doc/gpg.texi +++ b/doc/gpg.texi @@ -4591,10 +4591,10 @@ interface is described in the subsection ``How to manage your keys''. @subsection Unattended key generation The command @option{--generate-key} may be used along with the option -@option{--batch} for unattended key generation. This is the most -flexible way of generating keys, but it is also the most complex one. -Consider using the quick key manipulation interface described in the -previous subsection ``The quick key manipulation interface''. +@option{--batch} for unattended key generation. This is the legacy +way of generating key. New applications should consider the use of +the quick key manipulation interface described in the previous +subsection ``The quick key manipulation interface''. The parameters for the key are either read from stdin or given as a file on the command line. The format of the parameter file is as @@ -4722,8 +4722,10 @@ Default is to use the Pinentry dialog to ask for a passphrase. @item Name-Real: @var{name} @itemx Name-Comment: @var{comment} @itemx Name-Email: @var{email} +@itemx User-Id: @var{full-user-id} The three parts of a user name. Remember to use UTF-8 encoding here. -If you don't give any of them, no user ID is created. +As an alternative "User-Id" can be used to specify the entire user-id +with a single UTF-8 string. @item Expire-Date: @var{iso-date}|(@var{number}[d|w|m|y]) Set the expiration date for the key (and the subkey). It may either diff --git a/g10/keygen.c b/g10/keygen.c index 01ddb2e9b..8ca50a1a1 100644 --- a/g10/keygen.c +++ b/g10/keygen.c @@ -5195,6 +5195,7 @@ read_parameter_file (ctrl_t ctrl, const char *fname ) { "Name-Real", pNAMEREAL }, { "Name-Email", pNAMEEMAIL }, { "Name-Comment", pNAMECOMMENT }, + { "User-Id", pUSERID }, { "Expire-Date", pEXPIREDATE }, { "Subkey-Expire-Date", pSUBKEYEXPIREDATE }, { "Creation-Date", pCREATIONDATE }, -- cgit v1.2.3