[gnutls-dev] Using encrypted OpenPGP keys

Mario Lenz mario.lenz at gmx.net
Tue Aug 8 13:04:25 CEST 2006


Hi!

> #define _gnutls_openpgp_raw_privkey_to_gkey(pkey, raw_key) \
> _gnutls_openpgp_raw_privkey_to_gkey (pkey, raw_key, NULL)
> 
> (This should work, shouldn't it?)

No, it shouldn't. But this one seems to work:

#define _GNUTLS_OPENPGP_RAW_PRIVKEY_TO_GKEY(pkey, raw_key, passw, ...) \
  _gnutls_openpgp_raw_privkey_to_gkey(pkey, raw_key, passw)
#define _gnutls_openpgp_raw_privkey_to_gkey(pkey, raw_key, ...)\
  _GNUTLS_OPENPGP_RAW_PRIVKEY_TO_GKEY (pkey, raw_key, ## __VA_ARGS__,
NULL)

It's a dirty hack, but nevertheless it's imo better than adding
half a dozen a_very_long_long_name_indeed_enc functions to the already
existing a_very_long_long_name_indeed ones.

(The version without a password argument should marked as deprecated in
the documentation and removed in a later release, though.)

greez

   Mario






More information about the Gnutls-devel mailing list