Browse by Tags
All Tags »
System.Security (RSS)
Hi all You may get an Access Violation exception when loading a certificate into a X509Certificate2 object, only after installing KB 938397 hotfix ( crypt32.dll v5.131.3790.4095 ) at Applications that use the Cryptography API cannot validate an X.509
Read More...
Hi all, Do you want to work with CNG and .NET 3.5 and don't want to P/Invoke into CryptoAPI & CNG API ? Check out Security.Cryptography.dll library at CLR Security : " Security.Cryptography.dll provides a new set of algorithm implementations to augment
Read More...
Hi all, Some time ago a customer of mine was getting the following CryptographicException when calling EncryptedXml.DecryptDocument method to decrypt an XmlDocument in their .NET app: [System.Security.Cryptography.CryptographicException] = {" The data
Read More...
Hi all, When creating an X509Certificate object in your .NET application (" X509Certificate cert = new X509Certificate(certBytes); ") you may see that two 0kb files are created in the Temp folder of your Windows Server 2003 , and are never deleted . After
Read More...
Hi all, Before .NET Framework 3.5 SP1 , the default provider type for CspParameters was PROV_RSA_FULL (1) . Now it's PROV_RSA_AES (24) for all operating systems which support Microsoft Enhanced RSA and AES Cryptographic Provider (WinXP and higher). So
Read More...
Hi all, The following C# sample shows a dialog to view a certificate and its properties . This is the same dialog that appears when we double-click on the cert file in Explorer. I'll use CryptUIDlgViewCertificate API and its CRYPTUI_VIEWCERTIFICATE_STRUCT
Read More...
Hi all, When we use X509Chain class to verify if our certificate is not revoked, we may experience the following behavior: 1) We do an online verification ( X509Chain.ChainPolicy.RevocationMode set to X509RevocationMode.Online ) on a valid certificate
Read More...
Hi all, The other day a customer of mine had an interesting issue: a specific user runs their application for the first time without problem on a machine. Any other user can run the app without problems on the same machine, too. If that specific user
Read More...
Hi all, The other day a colleague of mine asked me if I had a .NET version of the C++ sample in How to generate key pairs, encrypt and decrypt data with CryptoAPI post. C++ sample calls CryptoAPI directly (and you know we can do the same thing in .NET
Read More...
Hi all, When working with RSACryptoServiceProvider , we may get an exception like the following: System.Security.Cryptography. CryptographicException : Unable to open the access token of the current thread at System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32
Read More...
Hi all, When using RSACryptoServiceProvider in i.e. ASP.NET you may get the following exception under a heavy load scenario: "System.Security.Cryptography.CryptographicException: CryptoAPI cryptographic service provider (CSP) for this implementation could
Read More...
Hi all, Today I'm posting a sample which shows how to sign a text with a certificate in my Personal store (this cert will have public and private key associated to it) and how to verify that signature with a .cer file (for i.e. WinForms) applications
Read More...
Hi all, welcome back, The following .NET 2.0 sample shows how to get security info from a folder to find out the permissions for users/groups on it: using System; using System.IO; using System.Security.AccessControl; using System.Security.Principal; namespace
Read More...
Hi all, Today I'm posting a sample which signs an XML with or without a certificate (PFX file) and verifies the signature, all that with .NET and its SignedXml class. I won't include in the sample the code that VS designer includes when I add the textboxes
Read More...
Hi, welcome back, When using System.Security.Cryptography.Xml.XmlDsigC14NTransform , depending on the input type ( XmlDsigC14NTransform.InputTypes ) being passed to its LoadInput method, the result of its GetOutput method could be different: - If we pass
Read More...