Forum Cross Platform with Xamarin


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

ProtectedData.Protect throws DllNotFound(crypt32.dll) exception

I am trying to use the ProtectedData class from System.Security.Cryptography to Protect and Unprotect some data. Both calls throw a DllNotFoundException:

System.DllNotFoundException: crypt32.dll
at (wrapper managed-to-native) System.Security.Cryptography.CAPIUnsafe:CryptProtectData (intptr,string,intptr,intptr,intptr,uint,intptr)
at System.Security.Cryptography.CAPI.CryptProtectData (IntPtr pDataIn, System.String szDataDescr, IntPtr pOptionalEntropy, IntPtr pvReserved, IntPtr pPromptStruct, UInt32 dwFlags, IntPtr pDataBlob) [0x0000d] in :0
at System.Security.Cryptography.ProtectedData.Protect (System.Byte[] userData, System.Byte[] optionalEntropy, DataProtectionScope scope) [0x000d1] in :0
at SageIdAuth.Auth.Storage.KeyManager.EncryptAndSave (System.Xml.XmlDocument document, System.String keyFile, System.String entropy) [0x0000f] in D:\Dev\Xamarin\SageIdAuth\SageIdAuth\SageIdAuth\Auth\Storage\KeyManager.cs:48


Sign In or Register to comment.