RSA Security Projection Television 5.2.2 Instrukcja Użytkownika Strona 186

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 376
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 185
Hash-Based Message Authentication Code (HMAC)
164 RSA BSAFE Crypto-C Developers Guide
Step 5: Final
After the data to digest has been processed by calls to B_DigestUpdate, call
B_DigestFinal. You need to pass a pointer to the location where B_DigestFinal can
store the output. In the case of
AI_HMAC using SHA1, you need 20 bytes to store the
result.
Step 6: Destroy
Once you have generated the message authentication code, destroy any objects you
used, and free up any memory you allocated:
unsigned char *digestedData;
unsigned int digestedDataLen;
digestedData = T_malloc (20);
if ((status = (digestedData == NULL_PTR)) != 0)
break;
if ((status = B_DigestFinal
(HMACDigester, digestedData, &digestedDataLen,
20, (A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;
B_DestroyKeyObject (&HMACKey);
B_DestroyAlgorithmObject (&randomAlgorithm);
B_DestroyAlgorithmObject (&HMACDigester);
if (digestedData != NULL_PTR) {
T_memset (digestedData, 0, 20);
T_free (digestedData);
digestedData = NULL_PTR;
digestedDataLen = 0;
}
Przeglądanie stron 185
1 2 ... 181 182 183 184 185 186 187 188 189 190 191 ... 375 376

Komentarze do niniejszej Instrukcji

Brak uwag