asn.1 - ASN 1 : before or after signature? -


assume there specific asn 1 representation specific message in standard. question have first sign message , then encoding according asn 1 or have first convert asn 1 , then sign it?

thank in advance help.

it depends on application, common practice format message in asn , sign resulting asn structure. follows:

signedmessage           ::= sequence {    tbsdata              tobesigneddata,    signaturealgorithm   algorithmidentifier {signature-algorithm,                             {sa-dsawithsha1 | sa-rsawithsha1 |                                  sa-rsawithmd5 | sa-rsawithmd2, ...}},    signature            bit string,    certs            [0] explicit sequence of certificate optional } } 

this means signature calculated on tbsdata structure.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -