Dr. Stephen Henson wrote:Thanks for your comments!!!On Wed, Sep 15, 2004, Antonio Ruiz Martínez wrote:Thanks for your answer, it has been very useful when I use an octect string but not when but I have got a problem when I'm using a sequence. I think I am not doing something properly because I don't get the desired result. I've tried the following options: I'm using the first solution 1), as you told me, that is... oct=ASN1_STRING_new(); if (!ASN1_STRING_set(oct,pkcs7inDER,lenPKCS7inDER)) { lReturn=-50; goto err; } p7=PKCS7_new(); if (p7==NULL) { lReturn=-20; goto err; } ...... si=sk_PKCS7_SIGNER_INFO_value(p7->d.sign->signer_info,0); if (si==NULL) { lReturn=-4; goto err; } PKCS7_add_attribute(si, NID_pkcs7_signed, V_ASN1_SEQUENCE,(char *)oct); And I'm getting a file that attach you. This file I can't decode it. d2i_PKCS7...How are you trying to decode it. I've been looking at that code... And I'm doing the same, I think...The technique I described is precisely that used to encode and decode the S/MIME capabilities attribute. See crypto/pkcs7/pk7_attr.c which I also wrote BTW :-) Have you got any idea? Regards, Antonio. |
test.der
Description: application/x509-ca-cert
