Sign in
Decrypt my World
Cryptography, Security, Debugging and more!
MSDN Blogs
>
Decrypt my World
Search
Options
About
RSS for posts
Atom
RSS for comments
OK
Disclaimer, Maps & Favorite Posts
Any of my posts is supported under any Microsoft standard support program or service. They are provided "AS IS" without warranty of any kind, and confer no rights.
Where are my readers?
Favorite Posts
Do you need help right now?
CryptoAPI Tracer script
MANAGED DEBUGGING with WINDBG. Introduction and Index
Tags
ADSI
CAPICOM
CertEnroll
CNG
CryptAcquireContext
CryptoAPI
Debugger scripts
Debugging
NT Services
P/Invoke
PowerShell
RSACryptoServiceProvider
SCard API
Smart Card
System.DirectoryServices
System.Security
VBScript
WinDbg
Windows 7
Windows SDK
Windows Server 2003
Windows Server 2008
Windows Vista
Windows XP
WMI
Archive
Archives
July 2012
(1)
May 2012
(1)
April 2012
(6)
March 2012
(2)
January 2012
(1)
November 2011
(12)
September 2011
(5)
June 2011
(1)
May 2011
(2)
April 2011
(1)
March 2011
(3)
February 2011
(6)
January 2011
(2)
December 2010
(5)
October 2010
(8)
September 2010
(1)
August 2010
(8)
July 2010
(3)
June 2010
(2)
May 2010
(4)
April 2010
(3)
March 2010
(4)
February 2010
(2)
January 2010
(5)
December 2009
(6)
November 2009
(2)
October 2009
(3)
September 2009
(5)
August 2009
(13)
July 2009
(8)
June 2009
(2)
May 2009
(7)
April 2009
(3)
March 2009
(2)
February 2009
(3)
January 2009
(3)
December 2008
(3)
November 2008
(2)
October 2008
(4)
September 2008
(4)
August 2008
(3)
July 2008
(3)
June 2008
(7)
May 2008
(6)
April 2008
(7)
March 2008
(10)
February 2008
(3)
January 2008
(4)
December 2007
(6)
November 2007
(4)
October 2007
(4)
Share this blog with others!!!
My Twitter (http://twitter.com/alejacma)
RSS
http://twitter.com/statuses/user_timeline/174391821.rss
Posts
Subscribe via RSS
Sort by:
Most Recent
|
Most Views
|
Most Comments
Excerpt View
|
Full Post View
Decrypt my World
Get-WmiObject : The type initializer for 'System.Management.MTAHelper' threw an exception
Posted
over 3 years ago
by
Alejandro Campos Magencio
4
Comments
Hi all, Sometime ago a customer of mine had some problems in his x64 machine when running WMI queries in Powershell . Take for instance the following query : " Get-WMIObject Win32_LogicalDisk " It failed with the following error...
Decrypt my World
System.DirectoryServices.AccountManagement.UserPrincipal.IsMemberOf returns false negatives
Posted
over 3 years ago
by
Alejandro Campos Magencio
1
Comments
Hi all, Sometime ago a customer of mine faced the following issue on his .NET Framework 3.5 app: System.DirectoryServices.AccountManagement.UserPrincipal.IsMemberOf returned false negatives when the group had more than 1500 members . This means...
Decrypt my World
Global hooks getting lost on Windows 7
Posted
over 3 years ago
by
Alejandro Campos Magencio
4
Comments
Hi all, Some time ago a customer of mine reported the following issue with SetWindowsHookEx API: Their application had global hooks to monitor for both keyboard and mouse input. On Windows 7 , and under high CPU usage, those hooks were getting...
Decrypt my World
How does CryptoAPI order the certificates in the stores?
Posted
over 3 years ago
by
Alejandro Campos Magencio
0
Comments
Hi all, The other day a customer of mine was trying to use OWA to sign an email with a specific certificate , with no success . To put you in situation, he had two certificates with very similar properties, but slightly different. When he accessed...
Decrypt my World
How to read msTSProfilePath, msTSHomeDrive and msTSHomeDirectory properties from AD (VB.NET)
Posted
over 3 years ago
by
Alejandro Campos Magencio
4
Comments
Hi all, If you used to query Active Directory properties like TerminalServicesProfilePath , TerminalServicesHomeDrive and TerminalServicesHomeDirectory on Windows Server 2003 , you may have realized already that those properties are not available on...
Decrypt my World
How to access the new Certificate Enrollment Web Services programmatically
Posted
over 3 years ago
by
Alejandro Campos Magencio
2
Comments
Hi all, Some time ago a customer of mine wanted to use the Windows Server 2008 R2 Certificate Enrollment Web Services , so they could send a PKCS#10 request and get the certificate back. They followed the instructions in this whitepaper: Certificate...
Decrypt my World
.NET and the CAdES standard
Posted
over 3 years ago
by
Alejandro Campos Magencio
0
Comments
Hi all, You may want to sign data and verify those signatures by following the CAdES standard in your .NET application. The issue is that, by default, we have no specific MS API or MS .NET security library to create or verify CAdES signatures. ...
Decrypt my World
Creating signatures with SignedXML following ebXML standard
Posted
over 3 years ago
by
Alejandro Campos Magencio
0
Comments
Hi all, The other day a customer of mine was trying to generate XML signatures following the ebXML standard with .NET and its SignedXML class. The main issue was that they didn't know how to refer in the signature the reference to an attachment that...
Decrypt my World
X.509 chain validation without CRL (C#)
Posted
over 3 years ago
by
Alejandro Campos Magencio
0
Comments
Hi all, The other day a customer of mine was trying to validate the chain of a cert like this: X509Certificate2 cert = new X509Certificate2(fileName); Console.WriteLine(String.Format("Certificate {0} is valid: {1}", fileName, cert.Verify()));...
Decrypt my World
Which standards does SignedXml support?
Posted
over 3 years ago
by
Alejandro Campos Magencio
0
Comments
Hi all, I've been working recently on a couple of issues with SignedXml not being able to generate XML signatures following certain standards or validate those signatures properly. Well, at the end we sometimes managed to make things work, but we must...
Decrypt my World
"NotTimeNested" not detected when doing chain validation
Posted
over 3 years ago
by
Alejandro Campos Magencio
1
Comments
Hi all, When doing certificate chain validation with X509Chain class in .NET, you may realize that the ChainStatus property doesn't return NotTimeNested , even if the certificate validity period is not nested in the issuing certificate validity period...
Decrypt my World
How to publish a printer in Active Directory (C#)
Posted
over 3 years ago
by
Alejandro Campos Magencio
0
Comments
Hi all, We may publish a printer attached to our machine in Active Directory . To do that on Windows 7 , for instance, we can go to "Devices and Printers" console , select "Printer Properties", go to "Sharing" tab, and mark the "List in the directory...
Decrypt my World
P/Invoking CryptoAPI in .NET. Part 2 (C#)
Posted
over 3 years ago
by
Alejandro Campos Magencio
2
Comments
Hi all, Some time ago I posted the following sample How to call CryptMsg API in streaming mode (C#) .Well, I continued working on that CryptMsg sample, and I got many consts, structs and API declarations that may help you if you need to p/invoke CryptoAPI...
Decrypt my World
How to call CryptEncodeObject in .NET (C#)
Posted
over 3 years ago
by
Alejandro Campos Magencio
4
Comments
Hi all, The other day a colleague of mine was having some issues to call CryptEncodeObject from C# . In order to assist, I created this sample for him: using System; using System.Collections.Generic; using System.ComponentModel; using System...
Decrypt my World
I'm on Twitter now!
Posted
over 3 years ago
by
Alejandro Campos Magencio
0
Comments
Hi all, I just joined the twitter community today: http://twitter.com/alejacma . I don't have much time to create lengthy posts lately, so I decided to give an opportunity to micro-blogging. I will keep posting Crypto, WinSDK and debugging stuff in...
Decrypt my World
How to request an smartcard logon cert programmatically (C#)
Posted
over 3 years ago
by
Alejandro Campos Magencio
3
Comments
Hi all, The other day I created this C# sample which shows how to request an smartcard logon cert to a CA . It is based on this other sample: How to create a certificate request with CertEnroll and .NET (C#) . using System; using System.Collections...
Decrypt my World
CryptoAPI and 5 bytes exponent public keys
Posted
over 3 years ago
by
Alejandro Campos Magencio
0
Comments
Hi all, One customer of mine wanted to import a public key he got from a partner. That public key had a 2048 bits modulus and a 5 bytes exponent . The problem was that CryptoAPI's RSAPUBKEY structure doesn't allow a 5 bytes exponent because it defines...
Decrypt my World
"Invalid provider type specified" when using CNG providers with .NET CMS classes
Posted
over 3 years ago
by
Alejandro Campos Magencio
0
Comments
Hi all, The other day a customer of mine got this exception when trying to use SignedCms and EnvelopedCms class with a CNG provider in their .NET 3.5 application: Exception type: System.Security.Cryptography.CryptographicException Message: Invalid...
Decrypt my World
"An internal error ocurred" when using AES algorithms with EnvelopedCms
Posted
over 3 years ago
by
Alejandro Campos Magencio
1
Comments
Hi all, The other day a customer of mine got this exception when trying to use AES algorithms with EnvelopedCms class in their .NET 3.5 application: Exception type: System.Security.Cryptography.CryptographicException Message: An internal error occurred...
Decrypt my World
"An internal error ocurred" when using SHA-2 algorithms with SignedCMS
Posted
over 3 years ago
by
Alejandro Campos Magencio
5
Comments
Hi all, The other day a customer of mine got this exception when trying to use SHA-2 algorithms with SignedCms class in their .NET 3.5 application: Exception type: System.Security.Cryptography.CryptographicException Message: An internal error occurred...
Decrypt my World
CertEnroll control won't work when hosted inside a frame/iframe in IE8 (FIX)
Posted
over 3 years ago
by
Alejandro Campos Magencio
0
Comments
Hello all, I recently posted about this issue: CertEnroll control won't work when hosted inside a frame/iframe in IE8 . I already mentioned that this was an issue on Windows 7 / Windows Server 2008 R2 , and proposed a few ways to work around this issue...
Decrypt my World
Invalid algorithm specified when signing with RSACryptoServiceProvider and SHA 256
Posted
over 3 years ago
by
Alejandro Campos Magencio
0
Comments
Hi all, The other day a customer of mine was getting the following error when signing with RSACryptoServiceProvider after specifying SHA 256 as hash algorithm: invalid algorithm specified . He was using a non-Microsoft CSP (Cryptographic Service Provider...
Decrypt my World
CertEnroll control won't work when hosted inside a frame/iframe in IE8
Posted
over 3 years ago
by
Alejandro Campos Magencio
3
Comments
Hi all, You may get errors like the following when using CertEnroll control in a web page hosted inside another page's frame/iframe : CertEnroll::CX509EnrollmentWebClassFactory::CreateObject: Unspecified error 0x80004005 (-2147467259) CertEnroll...
Decrypt my World
How to get info from client certificates issued by a CA (C#)
Posted
over 3 years ago
by
Alejandro Campos Magencio
1
Comments
Hi all, The following C# sample shows how to use Certadm.dll and CryptoAPI to get the name of the template and the enhanced usages of client certificates in a CA : <SAMPLE file="Form1.cs"> using System; using System.Collections.Generic; using...
Decrypt my World
How to get the AD groups a user is member of (ASP)
Posted
over 3 years ago
by
Alejandro Campos Magencio
0
Comments
Hi all, The following ASP sample shows how to get all Active Directory groups of the user accessing the ASP page. Note: I know ASP is quite old and people should be using ASP.NET instead. But I'm posting this sample because translating it to VBScript...
Page 3 of 9 (215 items)
1
2
3
4
5
»
Translate This Page
Translate this page
Powered by
Microsoft® Translator