Browse by Tags
All Tags »
CryptoAPI (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, The other day a customer of mine was trying to add an Authenticode signature with timestamp to their PowerShell scripts with PowerShell itself and its Set-AuthenticodeSignature cmdlet . He was able to sign the scripts just fine, but when using
Read More...
Hi all, The following C# sample uses CryptoAPI to read the info of a CRL ( Certificate Revocation List ) stored in a file: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text;
Read More...
Hi all, The following C++ sample shows how to use CertCreateSelfSignCertificate API to create a self-signed certificate . The private/public key pair will be created in the machine profile and the certificate will be stored in the Trusted Root CA store
Read More...
Hi all The other day I posted How to view a certificate programatically (C#) which includes a C# sample that we can use to view a certificate with CryptUIDlgViewCertificate API. This API shows the same dialog that appears when we double-click on the cert
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, If you try to use any SHA-2 algorithm ( SHA-256, SHA-384 and SHA-512 ) on Windows XP , you may get the following error when using i.e. CryptCreateHash : NTE_BAD_ALGID or -2146893816 or 0x80090008 or "Invalid algorithm specified" . Same algorithms
Read More...
Hi all, The other day I worked on the following issue: a customer of mine had developed an ActiveX which they used to sign some data in Internet Explorer . Their signing code was based on CryptoAPI and worked just fine with some certs, but failed with
Read More...
Hi all, welcome back, The other day a customer of mine was having an issue with SignTool.exe when signing an EXE file. The EXE file was getting corrupted /unusable after signing it. When troubleshooting this issue, I had the chance to play a bit more
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, Let's talk a bit about concurrency in CryptoAPI . When calling CryptoAPI from different threads , we have to take into consideration that key handles are not thread safe . The following document describes the threading issues when dealing with
Read More...