A question from Madrid (Spain)

View: New views
1 Messages — Rating Filter:   Alert me  

A question from Madrid (Spain)

by migueld2001 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi there,

This is Miguel from Madrid (Spain), and I would like to request you some support to start using Cryptlib.

We're created a pkcs15 file by using this code:

CRYPT_KEYSET kset;
int rec;
rec= cryptInit();
rec=cryptKeysetOpen( &kset, CRYPT_UNUSED, CRYPT_KEYSET_FILE, (const char *) FileName, CRYPT_KEYOPT_CREATE);
CRYPT_CONTEXT privKey;
res= cryptCreateContext( &privKey, CRYPT_UNUSED, CRYPT_ALGO_RSA);

res= cryptSetAttributeString( privKey, CRYPT_CTXINFO_LABEL, (const char *) KeyName,
                                                           strlen(KeyName));
res= cryptSetAttribute( privKey, CRYPT_CTXINFO_KEYSIZE, 1024/8);
res= cryptGenerateKey( privKey);
res= cryptAddPrivateKey( kset, privKey, (const char *)Password);
cryptKeysetClose( kset);

After that, we access this file by using this code:

rec= cryptInit();
rec=cryptKeysetOpen( &kset, CRYPT_UNUSED, CRYPT_KEYSET_FILE, (const char *) FileName, CRYPT_KEYOPT_NONE);

We have a big problem, because we created a pkcs15 file using cryptlib 3.1.0 version and we need to check some keys.

Now, using the 3.3.2 cryptlib version, we cannot access this file, and the function cryptKeysetOpen returns the following error:

"CRYPT_ERROR_OVERFLOW".

We need to check the file we created with 3.1.0 version, or convert it to be able to use it with the new version...

Any ideas?

Great thanks for your help

Miguel Angel
migueld@add4u.com