RSA Security Projection Television 5.2.2 Instrukcja Użytkownika Strona 267

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 376
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 266
Chapter 7 Public-Key Operations 245
Performing DSA Operations
properly cast NULL_PTR for the surrender context:
Step 4: Update
Digest the data to sign with B_SignUpdate, the prototype of which is in Chapter 4 of
the Reference Manual. Unless there is an extraordinarily large amount of data (for
example, a megabyte or more), this function is quick and a
NULL_PTR for the surrender
context should be no problem. Assuming you have some input data and you know its
length, your call is the following:
Step 5: Final
B_SignUpdate digested the data. Create the signature and send the result to a
signature buffer with
B_SignFinal. The signature will be as many as 48 bytes long, so
make sure the output buffer is big enough. The Reference Manual Chapter 2 entry on
AI_DSAWithSHA1 states:
This function does not return immediately, so a surrender context can be helpful. For
this example, use the surrender context described in The Surrender Context on
B_ALGORITHM_METHOD *DSA_SIGN_CHOOSER[] = {
&AM_SHA,
&AM_DSA_SIGN,
(B_ALGORITHM_METHOD *)NULL_PTR
};
if ((status = B_SignInit
(dsaSigner, dsaPrivateKey, DSA_SIGN_CHOOSER,
(A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;
if ((status = B_SignUpdate
(dsaSigner, inputData, inputDataLen,
(A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;
You must pass a random algorithm in B_SignFinal, but may pass
(B_ALGORITHM_OBJ)NULL_PTR for all other
randomAlgorithm
arguments.
Przeglądanie stron 266
1 2 ... 262 263 264 265 266 267 268 269 270 271 272 ... 375 376

Komentarze do niniejszej Instrukcji

Brak uwag