Questions tagged [mscapi]

The Cryptographic Application Programming Interface (MS-CAPI) is an application programming interface included with Microsoft Windows operating systems that provides services to enable developers to secure Windows-based applications using cryptography

The Cryptographic Application Programming Interface (also known variously as CryptoAPI, Microsoft Cryptography API, MS-CAPI or simply CAPI) is an application programming interface included with Microsoft Windows operating systems that provides services to enable developers to secure Windows-based applications using cryptography.

CryptoAPI is a set of dynamically linked libraries that provides an abstraction layer which isolates programmers from the code used to encrypt the data. The Crypto API was first introduced in Windows NT 4.0 and enhanced in subsequent versions.

CryptoAPI supports both public-key and symmetric key cryptography, though persistent symmetric keys are not supported. It includes functionality for encrypting and decrypting data and for authentication using digital certificates. It also includes a cryptographically secure pseudorandom number generator function CryptGenRandom.

CryptoAPI works with a number of CSPs (Cryptographic Service Providers) installed on the machine. CSPs are the modules that do the actual work of encoding and decoding data by performing the cryptographic functions. Vendors of HSMs may supply a CSP which works with their hardware.

via: Wikipedia

78 questions
71
votes
1 answer

Microsoft Crypto API Disable Use of RSAES-OAEP Key Transport Algorithm

I'm using CryptEncryptMessage to generate a PKCS#7 enveloped message. I'm using szOID_NIST_AES256_CBC as the encryption algorithm. The generated message appears to be valid but is the RSAES-OAEP for the Key Transport Algorithm which has limited…
user1775783
  • 818
  • 5
  • 4
27
votes
4 answers

Windows 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
  • 11,834
  • 17
  • 68
  • 86
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
  • 651
  • 5
  • 24
8
votes
2 answers

Accessing MS CryptoAPI with java

I was trying to make good use of the MS CAPI, and stumped into a great mischief... The SunMSCapi provider only, hmm, provides, per lack of better word, at least for signature, the following algorithms: MD2withRSA MD5withRSA SHA1withRSA And…
marcelo-ferraz
  • 3,147
  • 4
  • 38
  • 55
7
votes
1 answer

Does EKM work with CNG key storage providers?

https://learn.microsoft.com/en-us/sql/relational-databases/security/encryption/extensible-key-management-ekm says : SQL Server provides data encryption capabilities together with Extensible Key Management (EKM), using the Microsoft Cryptographic API…
prashant
  • 969
  • 3
  • 11
  • 22
5
votes
1 answer

OpenSSL and MS CryptoAPI: different digital signatures

I generated X509 certificate with private key using makecert utility makecert -n "CN=RootCATest" -r -sv RootCATest.pvk RootCATest.cer makecert -sk MyKeyName -iv RootCATest.pvk -n "CN=tempCert" -ic RootCATest.cer -sr currentuser -ss my -sky…
Stanislav
  • 425
  • 1
  • 5
  • 14
5
votes
2 answers

Does Microsoft Provides a PKCS #11 provider that connects to its own MS CryptoAPI?

I'm looking to run some tests using the PKCS #11 interface and was wondering if Microsoft provided a software based implementation the provides PKCS #11 functionality? Rather then waiting for a HSM to arrive and be properly configured I'd rather get…
Scott Markwell
  • 1,091
  • 2
  • 16
  • 33
5
votes
2 answers

How to get KeyStore from usb token in Java

I have a SafeNet 5100 eToken already with a valid certificate in it that I use to access a web application from my company that requires it (multi-factor authentication). I'm creating a desktop application to access this website. I am already able…
t.pimentel
  • 1,465
  • 3
  • 17
  • 24
4
votes
3 answers

Developing 64 bit applications that use MS CryptoAPI

I am a C++ developer, but don't have a strong background in Windows development. My main question revolves around the use of the Crypto API. I will use functions like CryptAcquireContext. While researching more about this API, described only as…
Cobaia
  • 1,503
  • 3
  • 22
  • 41
4
votes
2 answers

How to work with CryptoAPI via C#?

There is a group of CryptoApi functions which works with crypto service providers…
VoimiX
  • 1,180
  • 3
  • 16
  • 31
4
votes
0 answers

How to use "Microsoft Enhanced RSA and AES Cryptographic Provider" with Microsoft Active Directory Certificate Services?

I want to setup Microsoft Active Directory Certificate Services to use "Microsoft Enhanced RSA and AES Cryptographic Provider". Target: Windows 2016 server Data Center edition x64 running on VirtualBox. (Tested also on Win 2008 server…
4
votes
1 answer

Cryptoapi sign/verify not working on Windows 8.1

We have an application that signs and verifies messages with SHA1 hashes using CryptoApi. It has worked perfectly for many years under WindowsXP up to Windows 8. It no longer works on Windows 8.1. CryptSignHash fails with error code 87 (Invalid…
Alexander233
  • 390
  • 3
  • 12
3
votes
1 answer

MS CryptoAPI doesn't work on Windows XP with CryptAcquireContext()

I wrote some code using the Microsoft CryptoAPI to calculate a SHA-1 and got the compiled exe working on Windows 7, Win Server 2008, Win Server 2003. However, when I run it under Windows XP SP3, it does not work. I narrowed down the failure to…
JasDev
  • 726
  • 6
  • 13
3
votes
1 answer

How to use CAPI's CryptImportKey with PEM encode public key from OpenSSL?

How do I get the Microsoft's CryptoAPI CryptImportKey function to import a PEM encoded key? It actually works but CryptDecrypt returns an error. // 1. Generate a Public/Private RSA key pair like so: openssl genrsa -out private.pem 2048 openssl rsa…
pcunite
  • 1,197
  • 15
  • 23
3
votes
1 answer

disable individual buttons on a lispworks capi:push-button-panel

I'm working on a Connect Four game using common lisp and the LispWorks CAPI. I'm finished with the interface except for one thing: I use push-buttons (in a push-button-panel) to drop pieces into the columns, and I'd like to disable a button once…
smackcrane
  • 1,379
  • 2
  • 10
  • 17
1
2 3 4 5 6