Find correct key id's

Mohan Radhakrishnan mohanr at fss.co.in
Tue Jul 27 13:29:19 CEST 2010


Hi,

 

I have some questions about matching key id's.

        

1. I am trying to find the key id of the key that encrypted a file so
that I can use the corresponding decrypting key.

 

2. I am trying to use the correct decrypting key from the keyring using
the code shown here to decrypt.

 

Appreciate any advice ?

 

Thanks,

Mohan

 

 

 

                PGPSecretKey    prk = ( PGPSecretKey )keyIt.next();

                PGPPublicKey    puk = prk.getPublicKey();

 

                        sb.append(  "Private [" + prk.getKeyID() + "]
Public [" + puk.getKeyID() + "]\n" );

 

                        for( Iterator it = puk.getUserIDs() ;
it.hasNext() ;  ){

                              sb.append( "User ID [" + it.next() + "]\n"
);

                        }

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20100727/8df05039/attachment-0001.htm>


More information about the Gnupg-users mailing list