Friday, February 01, 2008

HowToUnix: GPG Automation

While automating encryption I faced the following issues.

$ gpg -q --yes -e -r Hasim File.txt
gpg: C2E7FAEF: There is no indication that this key really belongs to the owner
1024g/C2E7FAEF 2006-04-24 "Abul Hasim Molla "
Primary key fingerprint: B294 D02D D129 6224 B522 AE1F 4918 1E24 020C 23DC
Subkey fingerprint: 729E 52BF A281 0B2C 2073 7E27 262E DD2B 22E7 FCDF

It is NOT certain that the key belongs to the person named
in the user ID. If you *really* know what you are doing,
you may answer the next question with yes

Use this key anyway? y



I tried with so many options of gpg like as --no-tty,-q,---yes and so on.
Finally I solved it as follows:-

1/ You have to say that you trust the key and know the recipient well. Thats the solution.
To do so:-
gpg --edit-key NAME
$gpg --edit-key Hasim

gpg (GnuPG) 1.2.6; Copyright (C) 2004 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.


pub 1024D/0A0C23AC created: 2006-04-24 expires: never trust: -/-
sub 1024g/C2E7FAEF created: 2006-04-24 expires: never
(1). Abul Hasim Molla

Means your key status as per gpg is undefined and unknown.

2/ And then you will be take to the command mode.

Command> trust
pub 1024D/0A0C23AC created: 2006-04-24 expires: never trust: -/-
sub 1024g/C2E7FAEF created: 2006-04-24 expires: never
(1). Abul Hasim Molla

Please decide how far you trust this user to correctly
verify other users' keys (by looking at passports,
checking fingerprints from different sources...)?

1 = Don't know
2 = I do NOT trust
3 = I trust marginally
4 = I trust fully
5 = I trust ultimately
m = back to the main menu

Your decision?

3/ Say you trust him/her.
Your decision? 5
Do you really want to set this key to ultimate trust? y

pub 1024D/0A0C23AC created: 2006-04-24 expires: never trust: u/-
sub 1024g/C2E7FAEF created: 2006-04-24 expires: never
(1). Abul Hasim Molla
Please note that the shown key validity is not necessarily correct
unless you restart the program.

Command>quit

And your problem is resolved.

Labels:

1 Comments:

Blogger david santos said...

Thanks for your posting, Hasin.
Happy Chinese New Year!

4:21 AM  

Post a Comment

<< Home