SecureBlackbox 16: I am getting an 8219 (0x201B) error when trying to use a system certificate for signing. Still, I am able to use this certificate with other applications. Am I doing something wrong?
Note: This article applies only to SecureBlackbox Legacy. For future development please consider using the latest version.
This problem sometimes occurs on 64-bit operating systems when accessing certificates stored on hardware tokens with the TElWinCertStorage object. Some token vendors only implement 32-bit CSPs for their tokens, leaving the x64 version aside. (The CSP is a driver that sets up an interaction between the Microsoft CryptoAPI and the hardware token.) When a 64-bit process attempts to use such a certificate for signing, the system fails to find an appropriate 64-bit CSP to request a signing operation from and returns an error.
You can check if this is the case by changing the target platform of your .NET project to x86 (instead of AnyCPU or x64) and trying to perform signing in this mode. If the project signs data flawlessly in x86 mode but doesn't in x64/AnyCPU mode, then the driver is the reason.
We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at firstname.lastname@example.org.