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

Reply via email to