RSA Security Projection Television 5.2.2 Manual de usuario Pagina 308

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 376
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 307
Performing Elliptic Curve Operations
286 RSA BSAFE Crypto-C Developers Guide
Assume that the steps in Generating an Elliptic Curve Key Pair on page 268 have
been completed and that
publicKey
and
privateKey
are ready to be used.
Computing a Digital Signature
Step 1: Create
Declare a variable to be B_ALGORITHM_OBJ. As defined in the function prototype in
Chapter 4 of the Reference Manual, its address is the argument for
B_CreateAlgorithmObject:
Step 2: Set
The appropriate AI to use is AI_EC_DSAWithDigest. According to the entry in the
Reference Manual, you have to provide a pointer to a
B_DIGEST_SPECIFIER structure to
B_SetAlgorithmInfo:
Currently, the only digest algorithm supported is SHA1. This does not require any
parameters, so specify
NULL_PTR for
digestInfoParams
:
B_KEY_OBJ publicKey = (B_KEY_OBJ)NULL_PTR;
B_KEY_OBJ privateKey = (B_KEY_OBJ)NULL_PTR;
if ((status = GenerateECKeys (&publicKey, &privateKey,
&ecParamsObj, &randomAlgorithm) != 0)
B_ALGORITHM_OBJ ecDSASign = (B_ALGORITHM_OBJ)NULL_PTR;
if ((status = B_CreateAlgorithmObject (&ecDSASign)) != 0)
break;
typedef struct {
B_INFO_TYPE digestInfoType;
POINTER digestInfoParams;
} B_DIGEST_SPECIFIER;
Vista de pagina 307
1 2 ... 303 304 305 306 307 308 309 310 311 312 313 ... 375 376

Comentarios a estos manuales

Sin comentarios