Questions tagged [cryptoapi]

Cryptography API: Application programming interface that enables application developers to add authentication, encoding, and encryption to Windows-based applications. The API are oriented on the developer of unmanaged (native) applications in C/C++.

Cryptography API: Application programming interface that enables application developers to add authentication, encoding, and encryption to Windows-based applications. The API are oriented on the developer of unmanaged (native) applications in C/C++.

Microsoft cryptographic technologies include CryptoAPI, Next Generation (CNG), Cryptographic Service Providers (CSP), CryptoAPI Tools, CAPICOM, WinTrust, issuing and managing certificates, and developing customizable public key infrastructures. Certificate and smart card enrollment, certificate management, and custom module development are also described.

574 questions
51
votes
2 answers

How to generate an HMAC in Java equivalent to a Python example?

I'm looking at implementing an app getting Twitter authorization via Oauth in Java. The first step is getting a request token. Here is a Python example for app engine. To test my code, I am running Python and checking output with Java. Here is an…
dfrankow
  • 16,533
  • 35
  • 121
  • 177
28
votes
1 answer

Importing a DSA key from xml string fails for one user. Permissions? Broken installation? Bad KSP?

A user recently reported a weird error when using my software. I use DSA signatures to verify licenses. When the software imports the public key to verify a signature, the DSA provider's FromXmlString method throws a CryptographicException with the…
KristoferA
  • 11,859
  • 1
  • 34
  • 60
26
votes
3 answers

Window C/C++ Crypto API Examples and tips

I'm asking this question because I've spent the best part of a day trawling through msdn docs and other opaque sources for simple straightforward guidelines on how to get started with the Windows C/C++ Crypto API. What I'd like to see is some…
Gearoid Murphy
  • 10,997
  • 17
  • 60
  • 85
18
votes
2 answers

Delphi mutual authentication

I use the WinINet library to connect to a website. Using the Internet Explorer (Win10) it works and shows me the message to select the certificate to use. This is the delphi code I call: FUNCTION TRAD.lastOrganization(): Integer; VAR …
Grim
  • 4,939
  • 8
  • 46
  • 97
17
votes
3 answers

How to load Next Generation certificates from the Microsoft keystore using Java 8?

I'm trying to load certificates directly from the Microsoft store in order to avoid having to export certs from the MS store and then import them into a JKS store. I managed to get certs created from a typical AD CS web server template using legacy…
fstarnaud
  • 315
  • 1
  • 10
16
votes
1 answer

Generating HmacSHA256 signature in JUnit

I'm trying to sign my message to Amazon AWS (inside JUnit test), but I encountered a problem. Here's the code I'm using: String secretAccessKey = "secret1234678901"; SecretKeySpec keySpec = new SecretKeySpec(secretAccessKey.getBytes(UTF-8),…
Krzysztof Krasoń
  • 23,505
  • 14
  • 77
  • 102
16
votes
2 answers

Diffie-Hellman (to RC4) with Wincrypt From Python

I am currently working on a project written in C++ that leverages the CryptoAPI to perform a Diffie-Hellman key exchange. I'm having a bit of trouble getting this to work as the eventual RC4 session key I get cannot be used to encrypt the same text…
Jeremy
  • 163
  • 5
15
votes
3 answers

Load an PEM encoded X.509 certificate into Windows CryptoAPI

I need to load a PEM encoded X.509 certificate into a Windows Crypto API context to use with C++. They are the ones that have -----BEGIN RSA XXX KEY----- and -----END RSA XXX KEY-----. I found examples for Python and .NET but they use specific…
Migs
  • 815
  • 1
  • 9
  • 16
14
votes
1 answer

linking with openssl lib statically

I've build openssl manually (static libraries) following this guide now when I try to link my MFC test app with libeay32.lib I get following errors: 1>Linking... 1>libeay32.lib(e_capi.obj) : error LNK2019: unresolved external symbol…
cagi
  • 189
  • 1
  • 2
  • 10
13
votes
3 answers

Existing implementations for NIST SP 800-56A Concatenation/Single-Step Key Derivation Function?

Does anyone know of any existing implementations for NIST SP 800-56A Concatenation Key Derivation Function / CONCAT KDF (preferably in Java)? The key derivation function is documented in section 5.8.1 of NIST's publication: Recommendation for…
Lai Xin Chu
  • 2,432
  • 12
  • 29
12
votes
7 answers

how to use CryptoAPI in the linux kernel 2.6

I have been looking for some time but have not found anywhere near sufficient documentation / examples on how to use the CryptoAPI that comes with linux in the creation of syscalls / in kernel land. If anyone knows of a good source please let me…
Conor
  • 137
  • 1
  • 1
  • 5
12
votes
1 answer

Is there an API to pre-retrieve the list of trusted root certificates on Windows?

I am using Python and OpenSSL to connect to a site using TLS (in some cross-platform software, so it would be too much work to switch to CryptoAPI for everything); I don't want to distribute (and update) a custom list of certificates, though. I…
Glyph
  • 29,525
  • 9
  • 79
  • 112
9
votes
2 answers

MS Crypto API behavior on Windows XP vs Vista/7

I'm trying to understand how to get a public key imported from PEM format (sample included in the code below) across XP, Vista and Windows 7. The sample code will import the key on both XP and Windows Vista/7, but not the same way. On Windows XP,…
g01d
  • 501
  • 4
  • 18
9
votes
2 answers

How to suppress "An application is requesting access to a protected item" popup

I'm getting a pop-up when trying to use a certificate to decrypt data. I'm creating a self-signed certificate, and I'm using it to encrypt some data, but I'm getting the following confirmation pop-up when trying to decrypt the data: How can I…
lsotov
  • 135
  • 1
  • 2
  • 9
8
votes
2 answers

CryptoAPI: Using CryptVerifySignature to verify a signature from openssl with public key

I am trying to port the AquaticPrime framework for Mac to Windows. On the Mac, it uses the opensll library, and I try to understand how to port this to Windows, where I have to use the CryptoAPI, I guess. I mainly need the code for validation of the…
Thomas Tempelmann
  • 9,137
  • 6
  • 60
  • 120
1
2 3
38 39