Oscar wrote:
> 
> Does anybody knows what does idx means here:
> 
> PKCS7_ISSUER_AND_SERIAL *
>   PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx)
> 
> I have to use it but i don't do it ok because I don't understand.
> Thank's
> 

It seems to only work for signed and enveloped data. There isn't a
function which returns just this structure so you'll need to look into
the internals of structures.

E.g.

STACK_OF(PKCS7_SIGNER_INFO) *infos;
infos = PKCS7_get_signer_info(p7);

We now have sk_PKCS7_SIGNER_INFO(infos) signer info structures (usually
there will be at most one). You can access each with:

PKCS7_SIGNER_INFO *sinfo = sk_PKCS7_SIGNER_INFO_value(infos, idx);

where idx runs from zero to sk_PKCS7_SIGNER_INFO(infos) - 1.

The PKCS7_ISSUER_AND_SERIAL structure is then at
sinfo->issuer_and_serial.

This isn't very portable because later if we want to handle the S/MIME
v3 structures there may not even be an issuer and serial number
structure present.

Steve.
-- 
Dr Stephen N. Henson.   http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED] 
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the   OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to