CryptoSys PKI Pro Manual

Example: X509.KeyUsageFlags  X509.KeyUsageOptions 

[VB6 equivalent: X509_KeyUsageFlags]

Dim nRet As Integer
Dim strCertName As String
strCertName = "CarlRSASelf.cer"
nRet = X509.KeyUsageFlags(strCertName)
' Show the result as a hex number
Console.WriteLine("keyUsage flags are (0x{0:X}):", nRet)
' Check all the keyUsage flags in turn
If (nRet And X509.KeyUsageOptions.DigitalSignature) <> 0 Then Console.WriteLine("digitalSignature")
If (nRet And X509.KeyUsageOptions.NonRepudiation) <> 0 Then Console.WriteLine("nonRepudiation")
If (nRet And X509.KeyUsageOptions.KeyEncipherment) <> 0 Then Console.WriteLine("keyEncipherment")
If (nRet And X509.KeyUsageOptions.DataEncipherment) <> 0 Then Console.WriteLine("dataEncipherment")
If (nRet And X509.KeyUsageOptions.KeyAgreement) <> 0 Then Console.WriteLine("keyAgreement")
If (nRet And X509.KeyUsageOptions.KeyCertSign) <> 0 Then Console.WriteLine("keyCertSign")
If (nRet And X509.KeyUsageOptions.CrlSign) <> 0 Then Console.WriteLine("cRLSign")
If (nRet And X509.KeyUsageOptions.EncipherOnly) <> 0 Then Console.WriteLine("encipherOnly")
If (nRet And X509.KeyUsageOptions.DecipherOnly) <> 0 Then Console.WriteLine("decipherOnly")

See Also:
X509.KeyUsageFlags Method

[Contents] [Index]

[PREV: Example: X509.HashIssuerAndSN ...]   [Contents]   [Index]   
   [NEXT: Example: X509.CertOptions ...]

Copyright © 2004-23 D.I. Management Services Pty Ltd. All rights reserved. Generated 2023-09-18T10:02:53Z.