/* If Cert is NULL, then return FALSE. If CertSize is 0, then return FALSE. If this interface is not supported, then return FALSE. */
BOOLEAN EFIAPI X509GetVersion(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINTN *Version)
/* If Cert is NULL, then return FALSE. If CertSize is 0, then return FALSE. If this interface is not supported, then return FALSE. */
BOOLEAN EFIAPI X509GetVersion(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINTN *Version)
{
  BOOLEAN  Status;
  X509     *X509Cert;
  X509Cert = NULL;
  Status   = X509ConstructCertificate (Cert, CertSize, (UINT8 **)&X509Cert);
  if ((X509Cert == NULL) || (!Status)) {
    Status = FALSE;
  }
  if (Status) {
    *Version = X509_get_version (X509Cert);
  }
  if (X509Cert != NULL) {
    X509_free (X509Cert);
  }
  return Status;
}