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
1
vote
1 answer

Saving/Restoring certs with MS CryptoAPI invalidates attached private key

I've written a program which is supposed to save and restore a users certificates using the windows Crypto API. I was under the impression that it was working fine but now a user has complained that the private key that was attached to the…
Benj
  • 31,668
  • 17
  • 78
  • 127
1
vote
1 answer

Access Windows Local Machine Personal Keystore with Java (SunMSCAPI)

Is there a way to access the windows local machine personal key storage with Java using SunMSCAPI? Usually, you can use either WINDOWS-ROOT (which is roughly the equivalent to the trusted storage in Java) or WINDOWS-MY (which contains the personal…
P. Ekin
  • 15
  • 7
1
vote
1 answer

how to load private key in windows store using Java KeyStore

I am working on this Java project, where i need to load a private key from Windows KeyStore using the provider SunMSCAPI, but i don't supply any password at all, i don't know if i need to do so. this is sample test case of what i'm doing: public…
1
vote
2 answers

Get certificate from keystore not based on alias name in java

I am getting certificates from the keystore based on alias name using the below code, KeyStore keyStore = KeyStore.getInstance("Windows-MY"); Enumeration aliasesEnum = keyStore.aliases(); while(aliasesEnum.hasMoreElements()) { …
Vijaya
  • 157
  • 1
  • 16
1
vote
0 answers

Sign with private key and verify with public

OpenSSL's rsautl allows signing with a private key. This is without a hash. Then recovering the signed file with a public key. I've looked at CryptCreateHash/CryptSignHash/CryptHashData but I'm not sure how to do it. I believe those functions will…
StackPointer
  • 69
  • 1
  • 1
  • 5
1
vote
1 answer

Java security - MSCAPI provider: How to retrieve certificates from USB tokens only

I have managed to use Sun's MSCAPI provider in my applet. My applet simply lists certificates from Windows certificate store and lets user sign his/her transaction by allowing user select his/her preferred certificate. I would like to prevent users…
A. Erk.
  • 11
  • 4
1
vote
1 answer

Crypto API functions equivalent in C#

Earlier our Application-A was in C++ and a message was signed before sending it to Application-B using crypto API functions in C++ , exactly similar to the example described in…
srsyogesh
  • 609
  • 5
  • 17
1
vote
1 answer

Generating Certificate Policies Extension In C# Using Mono Security API

I appreciate any advice I can on this issue it has been driving me crazy and I cannot find any documentaion. I am currently trying to generate a self-signed root certificate in C# using the mono security api that meets certain requirements (RSA…
Ari
  • 563
  • 2
  • 17
1
vote
1 answer

Identifying CSP provider in CryptoAPI

I am using MS CAPI APIs for using a USB token for digital signing. using CryptAcquireContext, I can print out the names of all the CSPs available, but how do I know which CSP is associated with a plugged-in USB token? Moreover, what if there are…
sg1
  • 477
  • 1
  • 4
  • 21
1
vote
1 answer

Accessing PKCS12 stored certificate

I'm exploring a case where the stored certificate must be extracted for using with OpenSSL's (C++ application). It is imported to Local Computer\Personal store, and had contained a password-protected private key. What will be available to me via MS…
kagali-san
  • 2,964
  • 7
  • 48
  • 87
0
votes
0 answers

How to change the encrytion algorithm used to encrypt the assertion in ADFS?

I'm attempting to create a functionality that reads certificates from the Windows store. My setup involves an SSO-SAML enabled environment with ADFS as the identity provider (IdP). I've enabled encryption for the assertion. However, I'm encountering…
Mounika
  • 11
  • 3
0
votes
1 answer

mscapi java.security.ProviderException: java.security.KeyException:: The parameter is incorrect

I get "The parameter is incorrect" exception when I try decrypt the encrypted file with MSCAPI. I use RSAEncryptUtil.java utility and JDK 1.8.0_201 for this homework project. package hu.infokristaly.homework4rsaencdec; import…
Papp Zoltán
  • 131
  • 7
0
votes
1 answer

How to dynamically load Crypto Api (capi.dll) in openSSL 1.0.0 Win32 via Indy?

I use Indy 10 and I want my http client to use Windows store certificate. I use openssl libraries 1.0.0d which should allow me to load capi.dll, but load always fails. procedure TIdSSLContext.InitContext(CtxMode: TIdSSLCtxMode); var FEngine :…
OneMoreBug
  • 55
  • 6
0
votes
1 answer

how to extend features of HSM (Linux) using MSCAPI in Windows?

I am newbie for HSM. I want to access crypto functionality from HSM in Linux environment using MSCAPI. My client requirement is HSM should be accessible using MSCAPI. So I am in great confusion with how to extend HSM (HSM running in Linux) features…
Virudhai Paul
  • 81
  • 1
  • 9
0
votes
1 answer

Need an example - decrypting string in Java using Microsoft Crypto API

First and foremost, I am not a Java programmer. I'm looking for an example solution to this problem because the Java developer I have does not have much experience working with encryption. Everything we've found online pertains to encrypting web…
TomBodet