private static bool VerificaNonRepudiation(EsitoVerifica ev, bool fileOK, Org.BouncyCastle.X509.X509Certificate cert1)
{
/*
* digitalSignature (0),
* nonRepudiation (1),
* keyEncipherment (2),
* dataEncipherment (3),
* keyAgreement (4),
* keyCertSign (5),
* cRLSign (6),
* encipherOnly (7),
* decipherOnly (8)
*/
try
{
bool[] keyUsageBA = cert1.GetKeyUsage();
if (!keyUsageBA[1]) // Manca la no repudiation non va bene per i file firmati!!!
{
fileOK = false;
ev.status = EsitoVerificaStatus.ErroreGenerico;
ev.message = "La chiave certificata non e abilitata alla firma";
ev.errorCode = "1409";
}
}
catch
{
}
return(fileOK);
}