Org.BouncyCastle.X509.X509Certificate.GetKeyUsage C# (CSharp) Method

GetKeyUsage() public method

Get a key usage guidlines.
public GetKeyUsage ( ) : bool[]
return bool[]
        public virtual bool[] GetKeyUsage()
        {
            return keyUsage == null ? null : (bool[])keyUsage.Clone();
        }

Usage Example

Example #1
0
 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);
 }
All Usage Examples Of Org.BouncyCastle.X509.X509Certificate::GetKeyUsage