Dr. Stephen Henson wrote:
X509_get_pubkey() is useful for those cases: it just isn't complete.

You can check to see if parameters are missing using:

EVP_PKEY_missing_parameters(key);

You can copy parameters using:

EVP_PKEY_copy_parameters(to, from);

So before you replace the working_key with a new one check to see if the new
key has parameters, if not copy them from the current working key.

Thank You.

Now I have another question.
When I print policy mapping extension with X509V3_EXT_print() I get:

0:d=0  hl=2 l=  26 cons: SEQUENCE
2:d=1  hl=2 l=  24 cons: SEQUENCE
4:d=2  hl=2 l=  10 prim: OBJECT            :2.16.840.1.101.3.2.1.48.1
16:d=2  hl=2 l=  10 prim: OBJECT            :2.16.840.1.101.3.2.1.48.2

But when I try to extract this extension:

POLICY_MAPPINGS *polMaps = NULL;
polMaps = (POLICY_MAPPINGS*)X509_get_ext_d2i(cert, NID_policy_mappings, &crit, NULL);

I get NULL. This means polMaps is NULL and crit is -1 which is decoding problem.

What should I do to extract this extension correctly?

Thanks,
Daniel


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to