Thank you for your help.
I'm a bit confused here since the CheckCSP.exe reports 2 found certificates (with private keys) that are managed by the SysGillo CSP, while you earlier reported 4 certificates found. The CheckCSP.exe do basically the same thing as the JCAPI test program (hmm, it might be the fact you have certificates in the MY store without any private keys associated with them).
You have seen 2 certificates because the first test have been done in another pc(sorry for that),
In this pc,I have imported certificates from 2 smart keys and 2 tokens for test.
I'm very interested for jcapi library, and I would like to known about to pay it, and the licence.
This is java test's result:
Test signing with alias: MY|Ou/w6n6D3GyRoWROzg/uDg/X7oI=
Get certificate.
Alias is a key entry: true
Get private key.
Create signature.
Signature was successfully created.
Test signing with alias: MY|F4uD2dj7GrPZ+13eLt3guZqO0oI=
Get certificate.
Alias is a key entry: true
Get private key.
Create signature.
Signature was successfully created.
Test signing with alias: MY|DKwk6QyVkiPGNxeFwg0NdVPePi8=
Get certificate.
Alias is a key entry: true
Get private key.
Create signature.
Signature was successfully created.
Test signing with alias: MY|AhP5uoI6cz6/BMbFhCH1FcYXpjs=
Get certificate.
Alias is a key entry: true
Get private key.
Create signature.
Test done!.
java.security.SignatureException: Exception raised in JCAPI.DLL:
JCAPISignature_sign() - Could not calculate required signature buffer size.
at com.pheox.jcapi.h.b(Unknown Source)
at com.pheox.jcapi.l.engineSign(Unknown Source)
at java.security.Signature$Delegate.engineSign(Signature.java:112
at java.security.Signature.sign(Signature.java:522)
at TestSignature.testSign(TestSignature.java:5
at TestSignature.main(TestSignature.java:30)
It gives an error because this alias is not on this smart key, but it is strange that
for alias MY|AhP5uoI6cz6/BMbFhCH1FcYXpjs= the program asks me 2 times the pin.
This is the program's result:
C:\CheckCSP_2>CheckCSP.exe
Open system store 'My'.
Ok, found CSP 'SysGillo Cryptographic Service Provider'.
Now, check if there exists any certificates managed by the CSP.
Start searching for certificates in system store.
Found a certificate.
JCAPI alias = My|Ou/w6n6D3GyRoWROzg/uDg/X7oI=
The found certificate has an RSA private key used for decryption.
Key container: \\.\ACS USB 0\DS0
******** Key prov info ********
Container: \\.\ACS USB 0\DS0
Container len: 17
Provider: SysGillo Cryptographic Service Provider
Provider len: 39
ProvType: 1
Flags: 0
ProvParam: 0
KeySpec: 2
*******************************
Try to acquire context.
Acquire context succeeded.
Test creating a signature.
Time to sign the hash. This will require a private key and will this show a PIN dialog.
Signature successfully created.
Found a certificate.
JCAPI alias = My|F4uD2dj7GrPZ+13eLt3guZqO0oI=
The found certificate has an RSA private key used for decryption.
Key container: \\.\ACS USB 0\5c4b2e09-1b6a-48ef-978a-7c5e3ee3bcba
******** Key prov info ********
Container: \\.\ACS USB 0\5c4b2e09-1b6a-48ef-978a-7c5e3ee3bcba
Container len: 50
Provider: SysGillo Cryptographic Service Provider
Provider len: 39
ProvType: 1
Flags: 0
ProvParam: 0
KeySpec: 2
*******************************
Try to acquire context.
Acquire context succeeded.
Test creating a signature.
Time to sign the hash. This will require a private key and will this show a PIN dialog.
Signature successfully created.
Found a certificate.
JCAPI alias = My|DKwk6QyVkiPGNxeFwg0NdVPePi8=
The found certificate has an RSA private key used for decryption.
Key container: \\.\ACS USB 0\DS0
******** Key prov info ********
Container: \\.\ACS USB 0\DS0
Container len: 17
Provider: SysGillo Cryptographic Service Provider
Provider len: 39
ProvType: 1
Flags: 0
ProvParam: 0
KeySpec: 2
*******************************
Try to acquire context.
Acquire context succeeded.
Test creating a signature.
Time to sign the hash. This will require a private key and will this show a PIN dialog.
Signature successfully created.
Found a certificate.
JCAPI alias = My|AhP5uoI6cz6/BMbFhCH1FcYXpjs=
The found certificate has an RSA private key used for decryption.
Key container: \\.\ACS USB 0\b77fe5de-41c5-4317-9619-ac7a65a4c1ef
******** Key prov info ********
Container: \\.\ACS USB 0\b77fe5de-41c5-4317-9619-ac7a65a4c1ef
Container len: 50
Provider: SysGillo Cryptographic Service Provider
Provider len: 39
ProvType: 1
Flags: 0
ProvParam: 0
KeySpec: 2
*******************************
Try to acquire context.
Acquire context succeeded.
Test creating a signature.
Error code: 2148532266
Error msg: (null)
Could not use AT_SIGNATURE when calculating signature buffer size. Try AT_KEYEXCHANGE instead.
Error code: 2148532266
Error msg: (null)
Could not use AT_KEYEXCHANGE when calculating signature buffer size.
End searching for certificates in system store.
Close system store 'My'.
Regards,
Marco