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
2
votes
1 answer

Microsoft MSCAPI-CSP and CNG compatibility

We have previously developed an RSA MSCAPI CSP for use with the classical Windows crypto API and this has worked fine for years. Unfortunately, newer versions of Outlook refuse to work with this CSP in the case of AES encryption. It still supports…
Morty
  • 1,706
  • 1
  • 12
  • 25
2
votes
0 answers

SunMSCAPI not recognizing private keys for some keystore entries

I apologize that this is so long. If you are familiar with doing client-auth in Java you can probably skim/skip to the bottom. I took me a long time to find all the relevant bits of information from disparate sources. Maybe this will help someone…
JimmyJames
  • 1,356
  • 1
  • 12
  • 24
2
votes
2 answers

Microsoft CryptoAPI: how to convert PUBLICKEYBLOB to DER/PEM?

I have a generated RSA key pair stored as PRIVATEKEYBLOB and PUBLICKEYBLOB, and I need to be able to convert these keys to DER or PEM formats so I could use it in PHP or Python. I figured out that I could use CryptEncodeObject function to convert my…
user2102508
  • 1,009
  • 11
  • 23
2
votes
0 answers

MSCAPI : CNG and Security Descriptors

The Windows API provides ways to set security descriptors on objects (allowing the setup of Access Control Lists, for instance). Security Descriptors of cryptographic keys hosted by a Key Storage Provider (KSP) can be valued using the…
2
votes
2 answers

Verify OpenPGP based RSA signature with WinCrypt/CryptoAPI

I have code that parses OpenPGP packets and I have n, e of the public key packet as well as s of the signature packet as byte arrays. In order to verify a signature I first initialize CryptAcquireContext (I also tried with PROV_RSA_FULL instead of…
MrTux
  • 32,350
  • 30
  • 109
  • 146
2
votes
1 answer

AES/Rijndael in C++ Microsoft CryptoAPI

How can I convert the following cryptography code (VB.NET 4.0) to the C++ equivalent one, using Microsoft CryptoAPI (CryptDeriveKey, BCrypt[...] functions, CryptAcquireContext, etc.)? (I haven't found a single article on the Internet describing AES…
user3967841
2
votes
1 answer

InvalidKeyException using MSCAPI and IAIK

I use Sun's MSCAPI provider in my application to retrieve a signing certificate. The signer's privatekey is a sun.security.mscapi.RSAPrivateKey. IAIK does not seem to recognize this class (See error below). I do not understand why. What are the…
Cyril Bremaud
  • 117
  • 2
  • 9
2
votes
0 answers

Encrypt hashed data using SunMSCAPI JCE provider

I want to sign my data with RSA and SHA-1, but size of my data is so big. I refer this thread: Using SHA1 and RSA with java.security.Signature vs. MessageDigest and Cipher, and i'm trying to encrypt hashed data. When i use PKCS12 or PKCS11 provider…
ChenHuang
  • 382
  • 2
  • 11
2
votes
1 answer

Microsoft's cryptoAPI "Microsoft Enhanced RSA and AES Cryptographic Provider" selection doesn't working on win7

I want to use AES 256 bit enncrytion for data and it is provided by "MS_ENH_RSA_AES_PROV" .For that When I tried running below code with pszProviderName=TEXT("MS_ENH_RSA_AES_PROV") as 3rd parameter of CryptAcquireContext, I get output something…
chammu
  • 1,275
  • 1
  • 18
  • 26
2
votes
1 answer

how to yield lua script in C Function

it works when lua call a C API if a C function call lua function, and the lua function call C API, longjmp error lua_yieldk, lua_callk, and lua_pcallk how does it work? my c code: int trace(lua_State *L) { const char *str = luaL_checkstring(L,…
Eric T. Yuan
  • 35
  • 1
  • 4
2
votes
1 answer

How to obtain a user's identity from a smartcard on Windows (MSCAPI) with Java?

I'd like to obtain the user's identity from a smartcard (PKI) from a Java fat client on Windows with Sun's MSCAPIProvider. The target is: user opens the app prompted for card prompted for PIN I get the X509Certicate in Java grant access, etc. I…
Michael-O
  • 18,123
  • 6
  • 55
  • 121
2
votes
1 answer

Basic questions on Microsoft CryptoAPI

I've been looking through the MSDN trying to understand the crytoapi. Below are some questions and guesses as to how things might work. Any answers or confirmations or refuting of my surmises much appreciated. According to the note I found at…
Mike D
  • 2,753
  • 8
  • 44
  • 77
2
votes
1 answer

how to use Microsoft Crypto API with USB Dongle following PKCS#11

I have safenet authentication usb token which was given by a company and they told me they have digital public key certificate inside. They gave me a password and a software by which i can see that it can detect certificate inside. Now i need to…
wolvorinePk
  • 1,760
  • 5
  • 36
  • 67
1
vote
0 answers

File System Filter and CryptoAPI issue in Win CE

I have been working on a file system filter for the past two weeks and I have come across an interesting issue. I basically built the encoding/decoding implementation in an app that runs on the OS startup in Platform Builder first to verify that it…
Bernard
  • 995
  • 2
  • 9
  • 20
1
vote
1 answer

How to rename container name in cryptoki

I have write some code that writes keypair of public and private key in a token. From the keypair, I create pkcs10 and later generate certificate file from it. The certificate file will be inserted to the token. It all run successfully, but somehow…
Mace
  • 105
  • 2
  • 17