/* Enroll Cert into TlsCaCertificate. The GUID will be Private->CertGuid. */
EFI_STATUS EnrollCertDatabase(IN TLS_AUTH_CONFIG_PRIVATE_DATA *Private, IN CHAR16 *VariableName)
/* Enroll Cert into TlsCaCertificate. The GUID will be Private->CertGuid. */
EFI_STATUS EnrollCertDatabase(IN TLS_AUTH_CONFIG_PRIVATE_DATA *Private, IN CHAR16 *VariableName)
{
  UINT16  *FilePostFix;
  UINTN   NameLength;
  if ((Private->FileContext->FileName == NULL) || (Private->FileContext->FHandle == NULL) || (Private->CertGuid == NULL)) {
    return EFI_INVALID_PARAMETER;
  }
  NameLength = StrLen (Private->FileContext->FileName);
  if (NameLength <= 4) {
    return EFI_INVALID_PARAMETER;
  }
  FilePostFix = Private->FileContext->FileName + NameLength - 4;
  if (IsDerPemEncodeCertificate (FilePostFix)) {
    return EnrollX509toVariable (Private, VariableName);
  }
  return EFI_UNSUPPORTED;
}