On Wed, Dec 14, 2005, Vadim Godunko wrote:

> Hello,
> 
> I am tring to use X509_ATTRIBUTE in X.509 attribute certificate, but I am
> not undestand it usage. So, I use X509_ATTRIBUTE_create function for create
> attribute, but this work only for simple ASN.1 types (INTEGER, for
> example). Creatation of attributes of ASN1_SEQUENCE type raise segfault on
> i2d conversion.
> 
> Is it possible to reuse X509_ATTRIBUTE for complex ASN.1 structures? What I
> must do for that?

The X509_ATTRIBUTE type uses an ASN1_TYPE structure to hold the attribute
data. A SEQUENCE (and other structured types) is contained in an embedded
ASN1_STRING structure whose contents are the complete encoding of the relevant
type.

So you pass V_ASN1_SEQUENCE for the "attrtype" parameter and the encoding and
length in the "data" and "len" parameters respectively.

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                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to