/* Callback function for password phrase conversion used for retrieving the encrypted PEM. */
INTN PasswordCallback(OUT CHAR8 *Buf, IN INTN Size, IN INTN Flag, IN VOID *Key)
/* Callback function for password phrase conversion used for retrieving the encrypted PEM. */
INTN PasswordCallback(OUT CHAR8 *Buf, IN INTN Size, IN INTN Flag, IN VOID *Key)
{
  INTN  KeyLength;
  ZeroMem ((VOID *)Buf, (UINTN)Size);
  if (Key != NULL) {
    KeyLength = (INTN)AsciiStrLen ((CHAR8 *)Key);
    KeyLength = (KeyLength > Size) ? Size : KeyLength;
    CopyMem (Buf, Key, (UINTN)KeyLength);
    return KeyLength;
  } else {
    return 0;
  }
}