I am trying to get the RSA public key info in WinHTTP. So far I've got the certificate info in CERT_CONTEXT structure. I can get encryption algorithm and others as follows:
PCCERT_CONTEXT cert;
DWORD certLen =…
I need to mark a custom self-signed root certificate as trusted during certificate chain validation and, overall, I want to rely on the system API as much as possible.
I create a temporary memory store.
HCERTSTORE certStore =…
I am trying to sign a public/private key pair by a temporary Root CA, steps followed are next:
Create a self-signed root authority certificate (CertCreateSelfSignCertificate) (Done)
Generate public/private key pair (CryptGenKey) (Done)
Sign…
I used to work with crypto++ in Visual Studio before, but now I want to use of wincrypt.h API functions to encrypt a string with AES 256 with an IV (cbc mode).
I did bellow steps but I'm confused about CryptEncrypt() and CryptDecrypt() functions,…
I have a Smart Card (actually USB Token) with some certificate and keys written on it. Now I need to retrieve this certificate using python on Windows. How can it be achieved?
I had a look on pyscard package but it seems too low-level and probably…
I have this program working that encrypts a string of 9 bytes using AES128 from wincrypt.h but something strange happens when I change last character of the key:
from L"3igcZhRdWq96m3GUmTAiv2" to for example L"3igcZhRdWq96m3GUmTAiv1" or…
I use visual studio 2013 and windows 7 32bit.
I want to verify digital signature by root and chain of certificate.
So I get 0x80070057 error code in certcreatecertificatechainengine().
bool result = false;
HCERTCHAINENGINE …
We are trying to generate RSA SHA512 signature with CNG, we wrote code and generated hash value not matching with OpenSSL.
Private key used for signing we generated with OpenSSL command in DER format as below.
openssl genpkey -out privkey.pem…
I need to verify an .exe and ensure the publisher name matches the expected name (not based on a key since that can change as new code signing certificates are issued, the name is always the same).
I found samples of using WinVerifyTrust to verify a…
I need to verify a signed JAR file using Windows crypto API methods. I have only a basic understanding of encryption and signing matters. I'm also new to those crypto APIs (WinCrypt, Bcrypt, Ncrypt). Verifying the file hashes wasn't a problem, but…
I am trying to encrypt a text message with wincrypt. My code is however unpredictable. It doesn't encrypt/decrypt the whole plaintext but only a part of it. If i change the length of password (for example to "password123") it encrypts/decrypts a…
I am learning python and trying to convert the above code snippet found online to python.
As my understanding, the below code is generating the session key based upon SHA1 hash of the password "Microsoft" but I am not sure how I can derive AES 256…
Ok so I have 5 files I am encrypting. I am not setting the IV.
The fist file decrypt's fine,
then the first block of the remaining files is not decrypted.
So the files decrypt 99%.
Ive tried setting the IV to a static value and a random value, same…
I am trying to acquire a CNG private key handle to sign data per a certificate.
But I am struggling to get a valid key handle, in the first place.
The certificate lookup via fingerprint is working. I am recieving the context of a self signed…
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…