|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ASN1 unexpected end of dataCAPICOM in a .NET 1.1 application. I have a .NET 2.0 server which needs to reads this. So I did the regular base64 decode. The I found out while debugging that the original message is packed into a bunc of funky characters which I assume must be the signature. I tried using SignedCms like this, _____________________________________________________________________________ //After base64 decoding, UnicodeEncoding byteConverter = new UnicodeEncoding(); byte[] byteMessage = byteConverter.GetBytes(message); SignedCms cms = new SignedCms(); cms.Decode(byteMessage); // I get error at this point "ASN1 unexpected end of data" cms.CheckSignature(true); Anyone had this before?? Are you sure the binary data is unicode? Why not just pass the
base64-derived binary data directly into the CMS message? Joe K. -- Show quoteHide quoteJoe Kaplan-MS MVP Directory Services Programming Co-author of "The .NET Developer's Guide to Directory Services Programming" http://www.directoryprogramming.net -- "kplkumar" <kplku***@gmail.com> wrote in message news:1158675995.895468.238520@i3g2000cwc.googlegroups.com... >I have a message that is signed (attached) and encoded in base64 by > CAPICOM in a .NET 1.1 application. > > I have a .NET 2.0 server which needs to reads this. So I did the > regular base64 decode. The I found out while debugging that the > original message is packed into a bunc of funky characters which I > assume must be the signature. > > I tried using SignedCms like this, > _____________________________________________________________________________ > //After base64 decoding, > > UnicodeEncoding byteConverter = new UnicodeEncoding(); > byte[] byteMessage = byteConverter.GetBytes(message); > > SignedCms cms = new SignedCms(); > cms.Decode(byteMessage); // I get error at this point "ASN1 unexpected > end of data" > cms.CheckSignature(true); > > Anyone had this before?? > Signing in CAPICOM and verifying with .NET 2.0 is almost impossible.
Here are the links that talk about it, Search in google groups http://groups.google.com/group/microsoft.public.dotnet.security/browse_thread/thread/55dbd00ff4eb8218/a285373eb52985ca?lnk=st&q=capicom+%22.net+2.0%22&rnum=2&hl=en#a285373eb52985ca Microsoft declares this as well http://msdn.microsoft.com/library/default.asp?url=/library/en-us/seccrypto/security/encrypting_and_decrypting_data.asp and read the "Note" here http://msdn.microsoft.com/library/default.asp?url=/library/en-us/seccrypto/security/decrypting_a_message_in_capicom.asp if you want to implement this decoding yourself, here is some information and good luck!! http://www.jensign.com/JavaScience/dotnet/DeriveBytes/
GET the real content of a .p7m file with CAPICOM
IIS 6.0 Bug? Registry Permission Attributes Active Directory User Creation Issues Remoting IPCChannel security with Service Help-Please!!! PKI in .net Program Events over remoting and security problem, related/not related, I don't know Runtime Security Policy Question Windows Service Created Sub-process? |
|||||||||||||||||||||||