mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-28 22:49:59 +01:00
gpg: Add shortcut for setting key capabilities.
* g10/keygen.c (ask_key_flags): Add shortcut '='. * doc/help.txt (gpg.keygen.flags): New.
This commit is contained in:
parent
c76117f8b0
commit
b9b6ac9d26
35
doc/help.txt
35
doc/help.txt
@ -7,12 +7,12 @@
|
|||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 3 of the License, or
|
# the Free Software Foundation; either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# GnuPG is distributed in the hope that it will be useful,
|
# GnuPG is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
@ -27,7 +27,7 @@
|
|||||||
# /usr/share/gnupg/help.LL_TT.txt
|
# /usr/share/gnupg/help.LL_TT.txt
|
||||||
# /usr/share/gnupg/help.LL.txt
|
# /usr/share/gnupg/help.LL.txt
|
||||||
# /usr/share/gnupg/help.txt
|
# /usr/share/gnupg/help.txt
|
||||||
#
|
#
|
||||||
# Here LL_TT denotes the full name of the current locale with the
|
# Here LL_TT denotes the full name of the current locale with the
|
||||||
# territory (.e.g. "de_DE"), LL denotes just the locale name
|
# territory (.e.g. "de_DE"), LL denotes just the locale name
|
||||||
# (e.g. "de"). The first matching item is returned. To put a dot or
|
# (e.g. "de"). The first matching item is returned. To put a dot or
|
||||||
@ -44,7 +44,7 @@
|
|||||||
# the users about the configured passphrase constraints and save that
|
# the users about the configured passphrase constraints and save that
|
||||||
# to /etc/gnupg/help.txt. The help text should not be longer than
|
# to /etc/gnupg/help.txt. The help text should not be longer than
|
||||||
# about 800 characters.
|
# about 800 characters.
|
||||||
This bar indicates the quality of the passphrase entered above.
|
This bar indicates the quality of the passphrase entered above.
|
||||||
|
|
||||||
As long as the bar is shown in red, GnuPG considers the passphrase too
|
As long as the bar is shown in red, GnuPG considers the passphrase too
|
||||||
weak to accept. Please ask your administrator for details about the
|
weak to accept. Please ask your administrator for details about the
|
||||||
@ -55,7 +55,7 @@ configured passphrase constraints.
|
|||||||
.gnupg.agent-problem
|
.gnupg.agent-problem
|
||||||
# There was a problem accessing or starting the agent.
|
# There was a problem accessing or starting the agent.
|
||||||
It was either not possible to connect to a running Gpg-Agent or a
|
It was either not possible to connect to a running Gpg-Agent or a
|
||||||
communication problem with a running agent occurred.
|
communication problem with a running agent occurred.
|
||||||
|
|
||||||
The system uses a background process, called Gpg-Agent, for processing
|
The system uses a background process, called Gpg-Agent, for processing
|
||||||
private keys and to ask for passphrases. The agent is usually started
|
private keys and to ask for passphrases. The agent is usually started
|
||||||
@ -74,7 +74,7 @@ administrator anyway because this indicates a bug in the software.
|
|||||||
.gnupg.dirmngr-problem
|
.gnupg.dirmngr-problem
|
||||||
# There was a problen accessing the dirmngr.
|
# There was a problen accessing the dirmngr.
|
||||||
It was either not possible to connect to a running Dirmngr or a
|
It was either not possible to connect to a running Dirmngr or a
|
||||||
communication problem with a running Dirmngr occurred.
|
communication problem with a running Dirmngr occurred.
|
||||||
|
|
||||||
To lookup certificate revocation lists (CRLs), performing OCSP
|
To lookup certificate revocation lists (CRLs), performing OCSP
|
||||||
validation and to lookup keys through LDAP servers, the system uses an
|
validation and to lookup keys through LDAP servers, the system uses an
|
||||||
@ -134,13 +134,28 @@ Please consult your security expert first.
|
|||||||
.
|
.
|
||||||
|
|
||||||
|
|
||||||
|
.gpg.keygen.flags
|
||||||
|
Toggle the capabilities of the key.
|
||||||
|
|
||||||
|
It is only possible to toggle those capabilities which are possible
|
||||||
|
for the selected algorithm.
|
||||||
|
|
||||||
|
To quickly set the capabilities all at once it is possible to enter a
|
||||||
|
'=' as first character followed by a list of letters indicating the
|
||||||
|
capability to set: 's' for signing, 'e' for encryption, and 'a' for
|
||||||
|
authentication. Invalid letters and impossible capabilities are
|
||||||
|
ignored. This submenu is immediately closed after using this
|
||||||
|
shortcut.
|
||||||
|
.
|
||||||
|
|
||||||
|
|
||||||
.gpg.keygen.size
|
.gpg.keygen.size
|
||||||
Enter the size of the key.
|
Enter the size of the key.
|
||||||
|
|
||||||
The suggested default is usually a good choice.
|
The suggested default is usually a good choice.
|
||||||
|
|
||||||
If you want to use a large key size, for example 4096 bit, please
|
If you want to use a large key size, for example 4096 bit, please
|
||||||
think again whether it really makes sense for you. You may want
|
think again whether it really makes sense for you. You may want
|
||||||
to view the web page http://www.xkcd.com/538/ .
|
to view the web page http://www.xkcd.com/538/ .
|
||||||
.
|
.
|
||||||
|
|
||||||
@ -167,7 +182,7 @@ Answer "yes" or "no".
|
|||||||
|
|
||||||
|
|
||||||
.gpg.keygen.name
|
.gpg.keygen.name
|
||||||
Enter the name of the key holder.
|
Enter the name of the key holder.
|
||||||
The characters "<" and ">" are not allowed.
|
The characters "<" and ">" are not allowed.
|
||||||
Example: Heinrich Heine
|
Example: Heinrich Heine
|
||||||
.
|
.
|
||||||
@ -321,7 +336,7 @@ file (which is shown in brackets) will be used.
|
|||||||
.
|
.
|
||||||
|
|
||||||
.gpg.ask_revocation_reason.code
|
.gpg.ask_revocation_reason.code
|
||||||
# revoke.c (ask_revocation_reason)
|
# revoke.c (ask_revocation_reason)
|
||||||
You should specify a reason for the certification. Depending on the
|
You should specify a reason for the certification. Depending on the
|
||||||
context you have the ability to choose from this list:
|
context you have the ability to choose from this list:
|
||||||
"Key has been compromised"
|
"Key has been compromised"
|
||||||
|
18
g10/keygen.c
18
g10/keygen.c
@ -1591,6 +1591,7 @@ ask_key_flags(int algo,int subkey)
|
|||||||
*/
|
*/
|
||||||
const char *togglers=_("SsEeAaQq");
|
const char *togglers=_("SsEeAaQq");
|
||||||
char *answer=NULL;
|
char *answer=NULL;
|
||||||
|
const char *s;
|
||||||
unsigned int current=0;
|
unsigned int current=0;
|
||||||
unsigned int possible=openpgp_pk_algo_usage(algo);
|
unsigned int possible=openpgp_pk_algo_usage(algo);
|
||||||
|
|
||||||
@ -1637,7 +1638,22 @@ ask_key_flags(int algo,int subkey)
|
|||||||
answer = cpr_get("keygen.flags",_("Your selection? "));
|
answer = cpr_get("keygen.flags",_("Your selection? "));
|
||||||
cpr_kill_prompt();
|
cpr_kill_prompt();
|
||||||
|
|
||||||
if(strlen(answer)>1)
|
if (*answer == '=')
|
||||||
|
{
|
||||||
|
/* Hack to allow direct entry of the capabilities. */
|
||||||
|
current = 0;
|
||||||
|
for (s=answer+1; *s; s++)
|
||||||
|
{
|
||||||
|
if ((*s == 's' || *s == 'S') && (possible&PUBKEY_USAGE_SIG))
|
||||||
|
current |= PUBKEY_USAGE_SIG;
|
||||||
|
else if ((*s == 'e' || *s == 'E') && (possible&PUBKEY_USAGE_ENC))
|
||||||
|
current |= PUBKEY_USAGE_ENC;
|
||||||
|
else if ((*s == 'a' || *s == 'A') && (possible&PUBKEY_USAGE_AUTH))
|
||||||
|
current |= PUBKEY_USAGE_AUTH;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (strlen(answer)>1)
|
||||||
tty_printf(_("Invalid selection.\n"));
|
tty_printf(_("Invalid selection.\n"));
|
||||||
else if(*answer=='\0' || *answer==togglers[6] || *answer==togglers[7])
|
else if(*answer=='\0' || *answer==togglers[6] || *answer==togglers[7])
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user