RSA Security Projection Television 5.2.2 Manual de usuario Pagina 167

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 376
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 166
Chapter 4 Using Crypto-C 145
Using Cryptographic Hardware
Now that you have a key pair, extract the public key, part of the public key is a struct
containing the parameters.
Remember, the data in the A_DSA_PUBLIC_KEY struct belongs to the key object,
once you destroy that object, the data disappears. So either use the data before
B_ALGORITHM_METHOD *DSA_KEY_GEN_CHOOSER[] = {
&AM_DSA_KEY_GEN,
(B_ALGORITHM_METHOD *)NULL_PTR;
};
B_ALGORITHM_OBJ dsaKeyGen = (B_ALGORITHM_OBJ)NULL_PTR;
B_KEY_OBJ pubKey = (B_KEY_OBJ)NULL_PTR;
B_KEY_OBJ priKey = (B_KEY_OBJ)NULL_PTR;
if ((status = B_CreateAlgorithmObject (&dsaKeyGen)) != 0)
break;
if ((status = B_CreateKeyObject (&pubKey)) != 0)
break;
if ((status = B_CreateKeyObject (&priKey)) != 0)
break;
if ((status = B_GenerateParameters
(dsaParamGen, dsaKeyGen, randomObject,
NULL_SURR)) != 0)
break;
if ((status = B_GenerateInit
(dsaKeyGen, DSA_KEY_GEN_CHOOSER, NULL_SURR)) != 0)
break;
if ((status = B_GenerateKeypair
(dsaKeyGen, pubKey, priKey, random, NULL_SURR)) != 0)
break;
A_DSA_PUBLIC_KEY *pubKeyData;
if ((status = B_GetKeyInfo
((POINTER *)&pubKeyData, pubKey, KI_DSAPublic)) != 0)
break;
Vista de pagina 166
1 2 ... 162 163 164 165 166 167 168 169 170 171 172 ... 375 376

Comentarios a estos manuales

Sin comentarios