Error encrypting string data
Ralf Schneider
ralf@tapfere-schneiderleins.de
Thu, 24 Jul 2003 16:06:55 +0200
=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
one little problem again. As written before I managed to restore a key from=
my=20
own string format. But this only worked for the private key of a key pair.
When I try to recover a public key and check the key at the end with=20
gcry_ac_key_test I get the error message "Invalid object". This is what I d=
o:
gcry_ac_data_t keyData;
gcry_ac_key_t key;
=20
if (!setKeyData (keyData, parts)) // write the MPIs to keyData
return false;
rc =3D gcry_ac_key_init (&key, mHandle, GCRY_AC_KEY_PUBLIC, keyData);
if (rc)
return false;
rc =3D gcry_ac_key_test (key);
if (rc)
return false;
When I debug my code I see that there are 2 MPI values (n and e) that are=20
written to the data set. They have the same data as the first two MPI value=
s=20
of the corresponding private key. Is that correct?
Do I have to do anything else when restoring a public key?
Best regards,
Ralf.
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE/H+f/7YyyfykA0YkRArb6AJ4kPBu3iLzgs+nVtVa12qCw7AURYwCgleSN
0UKSFEHNCDC/aVIfu3c8Z1g=3D
=3DGYBr
=2D----END PGP SIGNATURE-----