Re: Importing an OpenPGP keyring to Cryptlib

Peter Gutmann <[email protected]> Sun, 17 Feb 2013 17:57:21 +1300
Newsgroups gmane.comp.encryption.cryptlib
Message-ID <[email protected]>
Lahiru Dissanayake <[email protected]> writes:

>I actually thought this was a standard format since it was exported from GPG
>Keychain Access program *and* Cryptlib was able to load it into a keyset.

It is a standard format, there are public keyrings and private keyrings.  This
particular file is a public keyring that turns into a private keyring halfway
through, which isn't standard.  cryptlib loaded it as a public keyring (which
it is, at least at the start of the file), but then since it turns into at
least some sort of private keyring at one point it couldn't do much with the
private keys.

>GPG Keychain Access was able to import the keys using the above binary data,
>but Cryptlib's cryptKeysetOpen() method couldn't.

GPG scans the keyring and then writes some a private key-database file to a
hidden directory, after which it uses the database in the hidden directory to
access keys.  It's probably this implementation quirk that allowed them to be
accessed via GPG.

>Seeing however, that Cryptlib *could* load* *the keyring* generated *by GPG
>Keychain Access (only later did I find out that it couldn't import the
>private key to a context), I thought this was a standard format.

It is a standard format.  What's not standard is storing private keys in a
public keyring, which is what this file contains.  It's explicitly not allowed
because if you share the public keys with someone then you're also handing
them copies of your private key.

Peter.


_______________________________________________
Cryptlib mailing list
[email protected] via Mail: [email protected]
Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/
http://news.gmane.org/gmane.comp.encryption.cryptlib
Posts from non-subscribed addresses are blocked to prevent spam, please
subscribe in order to post messages.