On Wed, Sep 15, 2004, Antonio Ruiz Martínez wrote:

> Hello!
> 
>    I've looking at the PKCS7_add_attribute function and I would like to 
> insert a signed PKCS7 as an attribute.
> 
> The header of the function is:
> 
> PKCS7_add_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype,void 
> *value);
> 
> I suppose that nid should be the NID_pkcs7_signed but I don't know which 
> values should be in atrtype (may it be V_ASN1_SEQUENCE ?) and in value 
> (der coding of the PKCS7? or the SEQUENCE of the PKCS7, in this case, 
> how can I get the sequence from the PKCS7?).
> 
> Could you help me, please?
> Regards,
> Antonio.
> 
> 

The NID is whatever OID is defined by whatever standard defines the syntax.
If there isn't a standard you might want to create a private OID and document
its meaning somewhere.

The meaning of atrtype and value are based on the ASN1_TYPE structure. For a
sequence atrtype is indeed V_ASN1_SEQUENCE and value is an ASN1_STRING
structure containing the encoding of the SEQUENCE.

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to