c# - Alternative for "System.Security.Cryptography.Pkcs" on Windows Mobile 6 -
For some time, I search for an option for "Except for System Security.Cryptography". On a Windows Mobile application developed with C # and DotNetFramework 3.5 In fact, I want to sign in and encrypt an XML file. I'm already feeling this operation on a desktop application: How can I customize this code for WinCE? Is it the option of Windows Mobile? Thank you for your help! is near Windows Mobile I do not think Microsoft has prepared a good C # BCL wrapper for this So, you'll need p / invoices. is a file encryption
X509Certificate2 cert = myCert; // Create contentInfo (which is signed) string msg = system IoOfile Readable text (xmlpath); Byte [] msgBytes = encoding. UTF8.GetBytes (msg); ContentInfo Content = New ContentInfo (msgBytes); // Signed an item signed by a signed message CMS signed message = New signed CMS (content); CMS Signer Signer = New CMS Signer (Certification); Signer.DigestAlgorithm = New Oid ("SHA1"); Signer.IncludeOptionExcludeOption = X509IncludeOption.EndCert only; // Signed message signed messages. Compute sign (signatory, wrong); Byte [] cmsMessage = Signed message. Hint (); // Encrypt message X509Certificate2 certificatePK = new X509Certificate2 (file .readlibets (public keypaypath)); ContentInfo contentSm = new contentinfo (cmsMessage); EnvelopedCms envelopedCms = new envelopedCms (contentSm); CMSRecipient Recipient = New CMSRecipient (SubjectIdentifierType.SubjectKeyIdentifier, CertificatePK); EnvelopedCms.Encrypt (recipient); Byte [] Encrypted Bates = Envelope CMS.ncode (); String str = System.Text.Encoding.Default.GetString (encrypted bits);
Comments
Post a Comment