Sorry, maybe I did not explain the content very well: A0 82 01 2E 04 82 01 2A + following content with length X'012A',
thus: A0 [0] 82 (length sign > 127) 01 2E length of everything following from here 04 octet string 82 (length sign > 127) 01 2A length of everything following from here content, with length 012A the question is if the tag X'04' is needed at all, normally it should, because the rule is 'EXPLICIT OCTET STRING' Kind regards/ Mit freundlichen GrĂ¼ssen /Salutacions cordials /Cordiali saluti/Cumprimentos Peter Byldner IBM Business Services SSO Enterprise Services WB AP Enabling tel. ++49-69-6645-5255 mobile: ++49-172-6759755 email: [EMAIL PROTECTED] "Ed Day" <[EMAIL PROTECTED]> 23.01.2007 14:50 Please respond to "Ed Day" <[EMAIL PROTECTED]> To <[email protected]>, Peter Byldner/Germany/[EMAIL PROTECTED] cc Subject Re: [Asn1] CMS eContent coding I think both alternatives are wrong. And the length in both is encoded wrong as well. Assuming the OCTET STRING contents are supposed to be 01 2E, the correct encoding should be: context 0 explicit tag -> 0xA0 length -> 0x04 OCTET STRING universal primitive tag -> 0x04 length ->0x02 content -> 0x01 0x2E => A0 04 04 02 01 2E Regards, Ed Day Objective Systems, Inc. http://www.obj-sys.com ----- Original Message ----- From: Peter Byldner To: [email protected] Sent: Tuesday, January 23, 2007 3:31 AM Subject: [Asn1] CMS eContent coding Hello, maybe there is some one having coded S/MIME before, I have one question about the DER encoding of a protocol element Coding the eContent in the signed-type the specification is: EncapsulatedContentInfo SEQUENCE { eContentType Content Type, eContent [0] EXPLICIT OCTET STRING OPTIONAL } The coding for the last element should be A0 82 01 2E - 04 82 01 2A followed by the user data ? I wonder if it is correct because some receiving S/MIME clients do not accept the tag for octet string X'04' as a tag but interpret it as data. In addition to that I have some questions about the MIME canonicalization especially regarding nested types and binary vers. application octet stream bodies. This part is not clear described in the rfc's. Maybe someone reading this message has coded CMS S/MIME before and has got any hints. Regards, Peter _______________________________________________ Asn1 mailing list [email protected] http://lists.asn1.org/mailman/listinfo/asn1
_______________________________________________ Asn1 mailing list [email protected] http://lists.asn1.org/mailman/listinfo/asn1
