windows/flutter_pkcs12_plugin.cpp
// Check if the given certificate has the Certificate Sign key usage
Check if the given certificate has the Certificate Sign key usage
Check if the given certificate has the Certificate Sign key usage
BOOL IsCACert(PCCERT_CONTEXT pContext)
{
  BOOL bStatus = FALSE;
  BYTE bKeyUsage;
  if (CertGetIntendedKeyUsage(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING,
                              pContext->pCertInfo,
                              &bKeyUsage,
                              1))
  {
    if (bKeyUsage & CERT_KEY_CERT_SIGN_KEY_USAGE)
    {
      bStatus = TRUE;
    }
  }
  return bStatus;
}
BOOL IsCACert ( PCCERT_CONTEXT pContext ) { BOOL bStatus = FALSE ; BYTE bKeyUsage ; if ( CertGetIntendedKeyUsage ( X509_ASN_ENCODING | PKCS_7_ASN_ENCODING , pContext -> pCertInfo , & bKeyUsage , 1 ) ) { if ( bKeyUsage & CERT_KEY_CERT_SIGN_KEY_USAGE ) { bStatus = TRUE ; } } return bStatus ; }
Check if the given certificate has the Certificate Sign key usage
Check if the given certificate has the Certificate Sign key usage
// Look at the key usage of the certificate