Windows error 0x80090016, -2146893802

Detailed Error Information

NTE_BAD_KEYSET[1]

MessageKeyset does not exist
Declared inwinerror.h

HRESULT analysis[2]

FlagsSeverityFailure
Reserved (R)false
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode9 (0x009)
NameFACILITY_SSPI[2][1]
DescriptionThe source of the error code is the Security API layer.[2][1]
Error Code22 (0x0016)

Questions

43votes
6answers

How do I add SSL to a .net application that uses httplistener - it will *not* be running on IIS

Most recent edits in bold I am using the .net HttpListener class, but I won't be running this application on IIS and am not using ASP.net. This web site describes what code to actually use to implement SSL with asp.net and this site describes how to set up the certificates [...] read more
.net
authentication
encryption
ssl
12votes
7answers

Keyset does not exist / Identity invalid

Note: I've found several questions similar on here, but the one's that were resolved did not work for me. So I thought I'd open a new question. I rebooted our server 2012 box, which hosts our new .net applications. After doing so, I started receiving a 503 error. Upon investigation, [...] read more
iis
windows-server-2012
8votes
1answer

Audit failure 5061 after logging in to Windows 10

Logging in to Windows 10 Build 10547 I see for a split second a message box pop up. There's no time to read it as the login succeeds. In the event log I see: Audit failure 5061 with a task category of System Integrity The event directly previous is fetching [...] read more
security
windows-10
login
event-log
rsa
4votes
1answer

Why do I lose my key container when I reboot?

For many years we have kept our strong name key in a key container. Visual Studio doesn't directly support that but, it works fine if you just edit the .csproj file and add: <KeyContainerName>MyKeyName</KeyContainerName> We install the key into the key store by doing: sn -m Y sn -i MyKeyFile.snk [...] read more
visual-studio
cryptography
cryptoapi
4votes
2answers

Error while changing identity for application pool

I try change identity for application pool on Windows Azure. My project uses this application pool when works on Windows Azure. By default application pool uses NetworkService identity, but I must use another identity. I try change it in OnStart() event of WebRole by this way: using (ServerManager serverManager = [...] read more
c#
windows
iis
azure
2votes
1answer

Can't import PFX with CERTUTIL -- "Keyset does not exist"

We have a PFX file that when used on any other Windows system (Server 2008 R2, 7, 8) installs fine. On 2 of my servers, the import fails like so: CertUtil: -importPFX command FAILED: 0x80090016 (-2146893802) CertUtil: Keyset does not exist We originally imported this PFX use the MMC snap-in, [...] read more
windows-server-2008-r2
iis-7.5
certutil
2votes
0answers

Adding private key to certificate with only public key on Windows Server in .NET

The following lines of code, which is part of a .NET FW 4.6.2 Console Application, execute without exceptions when run on a Windows 10. But when running on a Windows Server 2016 it causes a CryptographicException to be thrown when the Export method is called, saying Keyset does not exist [...] read more
c#
.net
certificate
x509
private-key
2votes
2answers

MS CryptoAPI - Machine Keystore with Error 0x80090016 (NTE_BAD_KEYSET) with certreq created keys

SUMMARY I create a PKCS#10 CSR with certreq and have set the option Exportable=TRUE. This successfully creates a key under the location REQUEST. I also have a valid certificate with key in MY. If I try to access any one of them the CryptoAPI reports error code 0x80090016. Running under [...] read more
c
openssl
cryptoapi
2votes
0answers

CryptProtectData fails with NTE_BAD_KEYSET (0x80090016) error on Windows XP when run from the local service

I'm using the following code from within my local service to scramble some sensitive data before it's saved in the HKLM key: LPCTSTR pStr = L"This is a plaintext string!"; DATA_BLOB blobIn; blobIn.pbData = (BYTE*)pStr; blobIn.cbData = lstrlen(pStr) * sizeof(TCHAR); DATA_BLOB blobOut = {0}; if(::CryptProtectData(&blobIn, NULL, NULL, NULL, NULL, CRYPTPROTECT_UI_FORBIDDEN, [...] read more
c++
windows
winapi
cryptoapi
2votes
0answers

Error in AES Encryption using C++

I have done Encryption of a File using C++ with ENCRYPT_ALGORITHM as CALG_RC4. The code is working fine. When I changed the ENCRYPT_ALGORITHM to CALG_AES_256 it fails. if(CryptAcquireContext( &hCryptProv, NULL, MS_ENHANCED_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) and if(!CryptDeriveKey( hCryptProv, ENCRYPT_ALGORITHM, hHash, KEYLENGTH, &hKey)) fails with the error no. 0x80090016 and 0x8009000f I want [...] read more
c++
encryption
aes
1vote
1answer

Problematic Active Directory CA certificate

i came across one DC, which gives me RPC errors when dealing with AD Certificate Service.I can see in AD there is 2 Root CA , one is problematic. Is it safe to remove it? Or is there a procedure for this ? windows Server 2012 R2 Event "Active Directory [...] read more
active-directory
windows-server-2012-r2
ad-certificate-services
1vote
1answer

Server 2008: Keyset does not exist when installing scheduled task

The product I work on has an installer that does a whole bunch of things, including installing regular files, setting registry keys, installing websites and web services on IIS and creating scheduled tasks. We have used this installer for years and now and then we have an issue with it [...] read more
windows-server-2008
scheduled-task
1vote
0answers

PC crashes on building a VS2008 WPF application

My PC crashes and restarts whenever i build a WPF application on my VS2008. I have no idea why this happens and i have collected the EventViewer logs for reference. One interesting thing to note is that the event source is from the .NET Runtime version 2.0.50727.3625 for a WPF [...] read more
windows-xp
.net-3.5
1vote
1answer

PFXExportCertStoreEx API not exporting private key to PFX file

I am trying to create creating a pfx file using PFXExportCertStoreEx API for a self-signed certificate and its corresponding private key. Self-signed Certificate exporting to pfx but private key not exporting to a pfx file. I set the export policy for the private key as below. export_policy = NCRYPT_ALLOW_EXPORT_FLAG | [...] read more
cryptography
cryptoapi
cng
wincrypt
0votes
1answer

Failure renewing root CA certificate - 0x80090016 NTE_BAD_KEYSET

We have a multi-tiered PKI infrastructure with a standalone, offline Root CA. Every year we go through a process of extending the root CA certificate (renewing while reusing existing keys) and reissuing the subordinate CA certificates. The server stays offline, except for that once per year process, when it is [...] read more
windows-server-2012-r2
certificate-authority
0votes
1answer

Reporting Services 2008 Service Account error

I saved over the encryption key backup file when changing from one account to another. Now I can't see reports, change accounts, or use any of the Encryption key tools in the configuration manager. I receive a > "Creating Encryption Key Backup" error 0x80090016 . Does anyone know how to [...] read more
sql-server
ssrs
0votes
1answer

Why am I getting this error when attempting to export a private key with Mimikatz?

I’m using Windows 10 (19041.867) and trying to use Mimikatz (2.2.0 20200918) to export a private key marked as non-exportable by the certificate export wizard. After using the following commands: crypto::capi crypto::certificates /export I get the following error for the private key export (XXX for privacy). Am I doing anything [...] read more
windows
certificate
private-key
0votes
1answer

Windows Server 2003 R2 Enterprise Edition

I am using Windows Server 2003 R2 and want to schedule a task using Task Scheduler but it gives the following error. 0x80090016: Keyset does not exist. Both Task scheduler and Protected storage service are running. Kindly help me how to resolve the issue? Thanks in advance. read more
windows-server-2003
0votes
0answers

CertUtil importpfx Keyset does not exist

I have a p12 file, 'test.p12,' that has a certificate, the CA cert (self-signed), and private key for the certificate. The p12 file is generated using the BouncyCastle's C# API. When trying to import the certificate by using 'CertUtil', i.e., 'CertUtil -f -p password -importpfx test.p12,' CertUtil generates the following [...] read more
windows
x509certificate
bouncycastle
certutil
0votes
0answers

Getting md5 hash code for dll file in c++

Hi guys i am trying to get dll md5 hash but it is returning same value all the time, what i did wrong? this dll is already loaded when i am trying to getHash i am getting hash with getHash() method and calculating it with CalcHash thnks in advanced. #define [...] read more
c++
hash
0votes
1answer

Why, after using 'CryptSetHashParam', can I no longer add data to my MD5 hash object?

I am trying to use the Microsoft 'Crypt...' functions to generate an MD5 hash key from the data that is added to the hash object. I am also trying to use the 'CryptSetHashParam' to set the hash object to a particular hash value before adding data to it. According to [...] read more
c++
cryptography
md5
hash
0votes
1answer

What exactly is a "persisted private key"?

I'm trying to use Microsoft's Crypto API to do some RSA. On Windows Vista and above, my code runs without problem. CryptAcquireContext(&m_hCryptProv, NULL, MS_ENHANCED_PROV, PROV_RSA_FULL, 0); Unfortunately, on the two Windows XP machines that I have tried, I get error code NTE_BAD_KEYSET (0x80090016). A little bit of googling found this [...] read more
rsa
-1votes
1answer

Translate WinApi Crypt to the .NET Framework System.Security.Cryptography

I would like to ask for a help with refactoring following C# code. The target is to remove all external WinApi call and replace them with methods from System.Security.Cryptography namespace. private static IntPtr GenerateKey(IntPtr hCryptProv, byte[] keyData) { var hHash = IntPtr.Zero; Win32.CryptCreateHash(hCryptProv, Win32.CALG_MD5, IntPtr.Zero, 0, ref hHash); var len [...] read more
c#
winapi
encryption
-2votes
1answer

Reporting Server cannot decrypt the symmetric key, trying to deploy SSRS reports

I am getting the following error when trying to deploy my SSRS reports on our SQL Server 2014 : > The report server cannot decrypt the symmetric key that is used to access > sensitive or encrypted data in a report server database. > You must either restore a backup [...] read more
sql-server

Comments

Leave a comment

(plain text only)

Sources

  1. winerror.h from Windows SDK 10.0.14393.0
  2. https://msdn.microsoft.com/en-us/library/cc231198.aspx

User contributions licensed under CC BY-SA 3.0