I'm trying to decode the serial number of a X.509 certificate, I opened with win32crypt in Python (http://timgolden.me.uk/pywin32-docs/PyCERT_CONTEXT.html)
import win32crypt
import sys
# lpszStoreProvider
CERT_STORE_PROV_SYSTEM = 0x0000000A
#…
I am trying to access a certificate that was created using a C# UWP app from a managed C++ DLL within that same application. I can't however use the C# interface as I need to support SNI on this socket (As far as I can tell, UWP does not support SNI…
I'm writing a code that would create a certificate in Certificate Store, and I'm using CNG. Actually not really writing, but adapting an example from MSDN. My code compiles, it creates keys for some algorithms, but none of those keys can be used to…
I have made such code that will create contex for aes encryption (with Win32API support):
if (!CryptAcquireContext(&hProvs, NULL, NULL, PROV_RSA_AES, CRYPT_VERIFYCONTEXT))
{
if (!CryptAcquireContext(&hProvs, NULL, NULL, PROV_RSA_AES,…
I am working with the crypto libraries and I am trying to create a simple password algorithm with the libraries. I used MSDN's Deriving a Session Key from a Password to generate keys by passing in a "username", but I'm not sure how to get the key…
I have to find CRL distribution point URL from a certificate. I managed to get obtain context (CERT_CONTEXT) of a certificate.
From this, how do I find CRL URL? To obtain publickeylength, there was a function CertGetPublicKeyLength. Similary is…
I try to integrate root certificate installation within my programm installer. I have to create an object from certificate and then add it to the store.
const std::string cert = R"cert(
-----BEGIN CERTIFICATE-----
/***/
-----END…
I want export programatically of a computer all my certificates of software separately to .pfx file to sign 2 new softwares that already are in final step of building in another pc.
To make this i found a C++ code example (that after i translate to…
I've been attempting to play around with the wincrypt api, but can't seem to figure out why the output from CryptEncrypt doesn't match the output from a language like Go.
wincrypt code
BYTE *inBuffer = (BYTE*)"Hello World";
HCRYPTPROV phProv =…
I followed this example. I am trying to add the public key which i got from the server into the key Pair and I am getting STATUS_INVALID_PARAMETER.
BCRYPT_DH_KEY_BLOB header;
header.dwMagic = BCRYPT_DH_PUBLIC_MAGIC;
header.cbKey =…
I am having the below code. I am setting a prime for diffie-hellman algorithm using char *.
I am getting bad data after i set the prime. Where am i doing wrong?
I followed the same example in this…
I am trying to use wincrypt to generate the private key using P and G values.
I get ERROR_INVALID_PARAMETER I am not sure what is wrong in my code. It is the same implementation as in example code given in microsoft…
I am working on a task in a C++ project to upgrade some components from building with VS2010 to build with VS2015 and noticed a strange behavior that I could not find any discussions online. Simplified code is as follows:
#include "stdafx.h"
int…
I need to encrypt strings under AES-128 for my C/C++ app making use of WinCrypt.
Just for understanding how the whole thing works, I have written a program to encrypt a 16 byte string with a 16 byte AES key (128 bits) but it is not working as…
I am using Sublime Text 3 (build 3126) with g++ on Windows 10 x64 to compile my c++. My code so far is:
#include
#include
#include
#include
using namespace std;
int main() {
return 0;
}
But when I…