Decrypt my World
Cryptography, Security, Debugging and more!
Get-WmiObject : The type initializer for 'System.Management.MTAHelper' threw an exception
Hi all, Sometime ago a customer of mine had some problems in his x64 machine when running WMI...
Author: Alejandro Campos Magencio Date: 10/20/2010
System.DirectoryServices.AccountManagement.UserPrincipal.IsMemberOf returns false negatives
Hi all, Sometime ago a customer of mine faced the following issue on his .NET Framework 3.5 app:...
Author: Alejandro Campos Magencio Date: 10/15/2010
Global hooks getting lost on Windows 7
Hi all, Some time ago a customer of mine reported the following issue with SetWindowsHookEx API:...
Author: Alejandro Campos Magencio Date: 10/14/2010
How does CryptoAPI order the certificates in the stores?
Hi all, The other day a customer of mine was trying to use OWA to sign an email with a specific...
Author: Alejandro Campos Magencio Date: 10/13/2010
How to read msTSProfilePath, msTSHomeDrive and msTSHomeDirectory properties from AD (VB.NET)
Hi all, If you used to query Active Directory properties like TerminalServicesProfilePath,...
Author: Alejandro Campos Magencio Date: 10/13/2010
How to access the new Certificate Enrollment Web Services programmatically
Hi all, Some time ago a customer of mine wanted to use the Windows Server 2008 R2 Certificate...
Author: Alejandro Campos Magencio Date: 10/08/2010
.NET and the CAdES standard
Hi all, You may want to sign data and verify those signatures by following the CAdES standard in...
Author: Alejandro Campos Magencio Date: 09/16/2010
Creating signatures with SignedXML following ebXML standard
Hi all, The other day a customer of mine was trying to generate XML signatures following the ebXML...
Author: Alejandro Campos Magencio Date: 08/18/2010
X.509 chain validation without CRL (C#)
Hi all, The other day a customer of mine was trying to validate the chain of a cert like this:...
Author: Alejandro Campos Magencio Date: 08/18/2010
Which standards does SignedXml support?
Hi all, I've been working recently on a couple of issues with SignedXml not being able to generate...
Author: Alejandro Campos Magencio Date: 08/17/2010
"NotTimeNested" not detected when doing chain validation
Hi all, When doing certificate chain validation with X509Chain class in .NET, you may realize that...
Author: Alejandro Campos Magencio Date: 08/17/2010
How to publish a printer in Active Directory (C#)
Hi all, We may publish a printer attached to our machine in Active Directory. To do that on Windows...
Author: Alejandro Campos Magencio Date: 08/17/2010
P/Invoking CryptoAPI in .NET. Part 2 (C#)
Hi all, Some time ago I posted the following sample How to call CryptMsg API in streaming mode...
Author: Alejandro Campos Magencio Date: 08/11/2010
How to call CryptEncodeObject in .NET (C#)
Hi all, The other day a colleague of mine was having some issues to call CryptEncodeObject from C#....
Author: Alejandro Campos Magencio Date: 08/11/2010
I'm on Twitter now!
Hi all, I just joined the twitter community today: https://twitter.com/alejacma. I don't have much...
Author: Alejandro Campos Magencio Date: 08/03/2010
How to request an smartcard logon cert programmatically (C#)
Hi all, The other day I created this C# sample which shows how to request an smartcard logon cert to...
Author: Alejandro Campos Magencio Date: 07/28/2010
CryptoAPI and 5 bytes exponent public keys
Hi all, One customer of mine wanted to import a public key he got from a partner. That public key...
Author: Alejandro Campos Magencio Date: 07/28/2010
"Invalid provider type specified" when using CNG providers with .NET CMS classes
Hi all, The other day a customer of mine got this exception when trying to use SignedCms and...
Author: Alejandro Campos Magencio Date: 07/28/2010
"An internal error ocurred" when using AES algorithms with EnvelopedCms
Hi all, The other day a customer of mine got this exception when trying to use AES algorithms with...
Author: Alejandro Campos Magencio Date: 06/07/2010
"An internal error ocurred" when using SHA-2 algorithms with SignedCMS
Hi all, The other day a customer of mine got this exception when trying to use SHA-2 algorithms with...
Author: Alejandro Campos Magencio Date: 06/02/2010
CertEnroll control won't work when hosted inside a frame/iframe in IE8 (FIX)
Hello all, I recently posted about this issue: CertEnroll control won't work when hosted inside a...
Author: Alejandro Campos Magencio Date: 05/25/2010
Invalid algorithm specified when signing with RSACryptoServiceProvider and SHA 256
Hi all, The other day a customer of mine was getting the following error when signing with...
Author: Alejandro Campos Magencio Date: 05/25/2010
CertEnroll control won't work when hosted inside a frame/iframe in IE8
Hi all, You may get errors like the following when using CertEnroll control in a web page hosted...
Author: Alejandro Campos Magencio Date: 05/25/2010
How to get info from client certificates issued by a CA (C#)
Hi all, The following C# sample shows how to use Certadm.dll and CryptoAPI to get the name of the...
Author: Alejandro Campos Magencio Date: 05/10/2010
How to get the AD groups a user is member of (ASP)
Hi all, The following ASP sample shows how to get all Active Directory groups of the user accessing...
Author: Alejandro Campos Magencio Date: 04/15/2010
SetWindowsHookEx fails with error ERROR_MOD_NOT_FOUND
Hi all, Some time ago a customer of mine was trying to add some global hooks (i.e. WH_CALLWNDPROC,...
Author: Alejandro Campos Magencio Date: 04/09/2010
How to call CryptMsg API in streaming mode (C#)
Hi all, The other day I posted an issue when signing large data with SignedCms in .NET (at least up...
Author: Alejandro Campos Magencio Date: 04/09/2010
ERROR_INVALID_DATA decrypting keyMaterial info from WiFi profile
Hi all, As you may know, you can use Native WiFi API to access WiFi profile data on a Windows...
Author: Alejandro Campos Magencio Date: 03/17/2010
"ASN1 value too large" error when calling SignedCms.ComputeSignature
Hi all, When signing large files ( > 100 MB) with SignedCMS.ComputeSignature in a .NET 3.5 SP1...
Author: Alejandro Campos Magencio Date: 03/17/2010
SendInput doesn't work but it doesn't return an error
Hi all, The other day a customer of mine was trying to use SendInput to simulate mouse and keyboard...
Author: Alejandro Campos Magencio Date: 03/17/2010
How to change drive letters (VBScript)
Hi all, Imagine you need to map some shared folders to specific drive letters for all users in your...
Author: Alejandro Campos Magencio Date: 03/17/2010
SignerSignEx returns error 0x80070020
Hi all, A customer of mine used my code in How to sign EXE files with an Authenticode certificate...
Author: Alejandro Campos Magencio Date: 02/17/2010
SignerSignEx returns error 0x800b0003
Hi all, A customer of mine tried my SignerSignEx sample in How to sign EXE files with an...
Author: Alejandro Campos Magencio Date: 02/17/2010
How to get all DCs in a Forest (VBScript)
Hi all, The following VBScript sample lists all DCs in a Forest:' Create log file ' Set objFSO =...
Author: Alejandro Campos Magencio Date: 01/13/2010
How to set sound volume programmatically
Hi all, From time to time I like to post about other issues which are not related to crypto stuff,...
Author: Alejandro Campos Magencio Date: 01/13/2010
How to change ownership and give full permissions to a user on a folder (VBScript)
Hi all, Some time ago we faced an issue where a customer renamed users in their domain, but their...
Author: Alejandro Campos Magencio Date: 01/13/2010
Do CNG certificates work on Windows XP?
Hi all, I posted some time ago about some issues that .NET 2.0/3.0/3.5 had with CNG certificates:...
Author: Alejandro Campos Magencio Date: 01/13/2010
WinHttpCertCfg tool cannot access private key of a certificate
Hi all, I faced the following issue some time ago: a customer of mine got a certificate in a .p12...
Author: Alejandro Campos Magencio Date: 01/11/2010
"Invalid provider type specified" error when accessing X509Certificate2.PrivateKey on CNG certificates
Hi all, You may get the following exception when trying to access X509Certificate2.PrivateKey on a...
Author: Alejandro Campos Magencio Date: 12/22/2009
Does SignTool work on Windows 7?
Hi all, The answer to the question of the title is YES, OF COURSE! Why wouldn't it? Well, the reason...
Author: Alejandro Campos Magencio Date: 12/14/2009
x64 version of SignTool?
Hi all, I was asked the other day if we had an x64 version of SignTool.exe. Up to date, the answer...
Author: Alejandro Campos Magencio Date: 12/13/2009
x64 version of CAPICOM?
Hi all, Now that we are progressively moving to x64 systems, many people ask me if there is an x64...
Author: Alejandro Campos Magencio Date: 12/13/2009
2.1.0.3, a new CAPICOM version?
Hi all, The other day I got surprised when a customer of mine told me that they had seen a new...
Author: Alejandro Campos Magencio Date: 12/04/2009
HttpWebClientProtocol.ClientCertificates and PFX files
Hi all, Imagine you want to call a webservice through SSL in a client application. You want to...
Author: Alejandro Campos Magencio Date: 12/02/2009
How to manipulate REG_MULTI_SZ values from the registry (C++)
Hi all, The other day I had to develop a small C++ sample which shows how to read the list of values...
Author: Alejandro Campos Magencio Date: 11/12/2009
Access Violation exception when loading a certificate in .NET (Windows Server 2003)
Hi all You may get an Access Violation exception when loading a certificate into a X509Certificate2...
Author: Alejandro Campos Magencio Date: 11/12/2009
CAPICOM support on Windows 7
Hi all, CAPICOM has finally been deprecated, and it won't be supported on Windows 7. This link is up...
Author: Alejandro Campos Magencio Date: 10/15/2009
Working with CNG in .NET 3.5
Hi all, Do you want to work with CNG and .NET 3.5 and don't want to P/Invoke into CryptoAPI &...
Author: Alejandro Campos Magencio Date: 10/14/2009
CryptographicException: The data to be decrypted exceeds the maximum for this modulus of 0 bytes
Hi all, Some time ago a customer of mine was getting the following CryptographicException when...
Author: Alejandro Campos Magencio Date: 10/09/2009
X509Certificate creates temporary files which are never deleted
Hi all, When creating an X509Certificate object in your .NET application ("X509Certificate cert =...
Author: Alejandro Campos Magencio Date: 09/30/2009