cryptoapi

SSL Connection, Windows Certificate Store and CAPI engine

妖精的绣舞 提交于 2019-12-30 10:47:26
问题 I am creating an SSL connection using OpenSSL API. As we know in a SSL handshake, series of Certificate Authentication occurs for Server or Client. Now for client certificate authentication, the client's certificate and associated private key are stored in Windows Certificate Store . This certificate with private key is imported into the store after combining them into a pfx format and then that pfx file is imported to the windows Cert store. Now while importing this pfx file using mmc snap

CertCreateCertificateChainEngine returning “Invalid Parameter” (0x80070057)

醉酒当歌 提交于 2019-12-25 10:21:33
问题 I have been trying to create a non-default certificate chain using modified version of an example posted https://msdn.microsoft.com/en-us/library/windows/desktop/aa382042(v=vs.85).aspx CERT_CHAIN_ENGINE_CONFIG chainConfig; HCERTCHAINENGINE hChainEngine; :: SecureZeroMemory (&chainConfig, sizeof (CERT_CHAIN_ENGINE_CONFIG)); chainConfig.cbSize = sizeof(chainConfig); chainConfig.hRestrictedRoot = NULL; chainConfig.hRestrictedTrust = NULL; chainConfig.hRestrictedOther = NULL; // Following two

CertCreateCertificateChainEngine returning “Invalid Parameter” (0x80070057)

狂风中的少年 提交于 2019-12-25 10:19:09
问题 I have been trying to create a non-default certificate chain using modified version of an example posted https://msdn.microsoft.com/en-us/library/windows/desktop/aa382042(v=vs.85).aspx CERT_CHAIN_ENGINE_CONFIG chainConfig; HCERTCHAINENGINE hChainEngine; :: SecureZeroMemory (&chainConfig, sizeof (CERT_CHAIN_ENGINE_CONFIG)); chainConfig.cbSize = sizeof(chainConfig); chainConfig.hRestrictedRoot = NULL; chainConfig.hRestrictedTrust = NULL; chainConfig.hRestrictedOther = NULL; // Following two

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

核能气质少年 提交于 2019-12-24 12:43:53
问题 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 different access rights could not solve this problem so far. Goal My goal is to get both the keys in MY and REQUEST . If I call CryptAcquireContextA() on any of those, it fails. System Windows 7 x64 Sample

PKCS#10 request for a object key pair from PKCS#11

♀尐吖头ヾ 提交于 2019-12-24 08:42:21
问题 I have a RSA 1024 key pair generated using standard call from PKCS#11. I need to generate a PKCS#10 CSR for the public key. MS has the IEnroll4 dll which will allow to raise a CSR using createRequestWStr. The samples indicate that you need to generate a new key pair(a container with 2 objects in MS CAPI) and MS automatically gives the the public key context for csr generation. In my case, I already have a key pair generated using pkcs#11(as 2 objects but no key container). MS dll is not

Exporting PFX file from windows certificates store

僤鯓⒐⒋嵵緔 提交于 2019-12-24 06:47:29
问题 Our application uses OpenSSL for securing communication between client device and server. The certificates are generated by customers CA and we had to upload server certificate and private key to Windows OS based machine. Until now we guide our customers to save a PEM files which include server certificate and private key at specific directory on server file system and our application upload it from there. Lately, we were asked by customer to read a PFX certificate from local windows

Is it possible to do a HMAC with wincrypt?

佐手、 提交于 2019-12-24 01:53:10
问题 I've been trying to perform a straight forward SHA256 HMAC using wincrypt/cryptoapi/Cryptography API: Next Generation (CNG) and i'm really struggling. My target is Windows 8. I can not find the correct methods or find any examples anywhere. I am looking to do the following in C/C++, that is demonstrated in C# below HMAC hashMaker = new HMACSHA256(Encoding.ASCII.GetBytes("SecretKey")); byte[] hash = hashMaker.ComputeHash(Encoding.ASCII.GetBytes("<SomeXmlData />")); string hashStr =

How to export certificate from Windows certificate store via CryptoAPI as Base64 string

倖福魔咒の 提交于 2019-12-23 19:29:36
问题 i've got following C# code for doing what i asked for in subject: public static void ExportCertificatesToFile(string FileName) { stringBuilder builder = new StringBuilder(); X509Store storeMy = new X509Store(StoreName.My); storeMy.Open(OpenFlags.ReadOnly); foreach (X509Certificate2 cert in storeMy.Certificates) { builder.AppendLine("-----BEGIN CERTIFICATE-----"); builder.AppendLine(Convert.ToBase64String(cert.Export(X509ContentType.Cert), Base64FormattingOptions.InsertLineBreaks)); builder

To implement HMAC-MD5 crypto algorithm in an Win32 application

别等时光非礼了梦想. 提交于 2019-12-23 05:01:58
问题 I have a Win32 application that has to implement algorithm NTLM v2 Authentication in accordance to http://msdn.microsoft.com/en-us/library/cc236700(v=PROT.10).aspx. Partially, I need an implementation of crypto algorithm HMAC_MD5(). I see Win32 Crypto API contains function CryptCreateHash; but cannot understand: how to use it for the HMAC-MD5? Can someone explain me or give an example? 回答1: Generic example at http://msdn.microsoft.com/en-us/library/aa382379%28v=vs.85%29.aspx. You might want

How many Bitcoin addresses can I generate through Coinbase API?

南楼画角 提交于 2019-12-22 12:38:12
问题 I use Coinbase API to generate Bitcoin addresses. What are the limits of this API? How many Bitcoin addresses can I generate? 回答1: The API says that: The Coinbase API is rate limited to prevent abuse that would degrade our ability to maintain consistent API performance for all users. By default, each API key or app is rate limited at 10,000 requests per hour. If your requests are being rate limited, HTTP response code 429 will be returned with an rate_limit_exceeded error. So I would reason