[Cdsa-dev] problem whith CSSM_WrapKey. help me, please.
Status: Abandoned
Brought to you by:
mdwood-intel
|
From: <ni...@gs...> - 2002-02-27 16:14:18
|
First of all I want to thank YOU for previously aid gived to me.
Unfortunately me a new problem has been introduced:
1) I create a key pairs.
2) I create a symmetrical key (than I "wrap" with the public key created =
previously) with which I decipher a file.
When I try to "wrap" the symmetrical key, the error generated is:
number 8194 --> "CSSMERR_CSP_MEMORY_ERROR".
The fundamental steps are:
1) To crete a key-pairs:
ret =3D CSSM_CSP_CreateKeyGenContext( csp,
CSSM_ALGID_RSA,
512,
NULL,
NULL,
NULL,
NULL,
NULL,
&ctx );
ret =3D CSSM_GenerateKeyPair( ctx,
CSSM_KEYUSE_WRAP,
CSSM_KEYATTR_RETURN_DATA | CSSM_KEYATTR_EXT=
RACTABLE,
NULL,
&PubKey,
CSSM_KEYUSE_UNWRAP,
CSSM_KEYATTR_RETURN_DATA | CSSM_KEYATTR_EXT=
RACTABLE,
NULL,
NULL,
&PriKey );
later I write on 2 files the key-pairs.
2) To encrypt:
ret =3D CSSM_CSP_CreateKeyGenContext( csp,
CSSM_ALGID_DES,
64,
NULL,
NULL,
NULL,
NULL,
NULL,
&ctx );
=20
ret =3D CSSM_GenerateKey( ctx,
CSSM_KEYUSE_ENCRYPT | CSSM_KEYUSE_DECRYPT,
CSSM_KEYATTR_EXTRACTABLE | CSSM_KEYATTR_RETURN_=
DATA,
NULL,
NULL,
&SimKey );
subsequently recovery the key-pairs from the files and I store them into =
PubKey and PriKey.
ret =3D CSSM_CSP_CreateAsymmetricContext( csp,
CSSM_ALGID_RSA,
NULL,
&PubKey,
CSSM_PADDING_NONE,
&ctx );
ret =3D CSSM_WrapKey( ctx,
NULL,
&SimKey,
NULL,
&WrappedKey );
P.S.
if I execute in cascade the generation of the key-pairs and the "wrap", g=
oes all good.
If I execute the generation of the key-pairs, then I exit from the progra=
m and then I try to "wrap", generates me the error brought back over.
Sorry for the length of the mail, thank in advance.
Pietro.
-----------------------------------------------------------------
Questo messaggio =E8 stato inviato utilizzando http://it.my.gsmbox.com=20
|