CertificateIssuer Property | ||||||||||||||||
Syntax
Remarks
Data Type
ExampleFunction GetCertNameValue(ByVal strValue As String, ByVal strFieldName As String) As String Dim strFieldValue As String Dim cchValue As Integer, cchFieldName As Integer Dim nOffset As Integer GetCertNameValue = "" cchValue = Len(strValue) cchFieldName = Len(strFieldName) If cchValue = 0 Or cchFieldName = 0 Then Exit Function End If nOffset = InStr(strValue, strFieldName & "=") If nOffset > 0 Then ' ' If the field name was found in the string, then ' remove everything to the left of the token from ' the string ' strFieldValue = Right(strValue, cchValue - (nOffset + cchFieldName)) ' ' If the value is quoted, then strip off the leading ' quote and look for the ending quote in the string; ' otherwise look for the comma that marks the end of ' the field name/value pair ' If Left(strFieldValue, 1) = Chr(34) Then strFieldValue = Right(strFieldValue, Len(strFieldValue) - 1) nOffset = InStr(strFieldValue, Chr(34)) Else nOffset = InStr(strFieldValue, ",") End If ' ' If the offset is 0, then the name/value pair is ' the last token in the string; otherwise, remove ' everything to the right of that position ' If nOffset > 0 Then strFieldValue = Left(strFieldValue, nOffset - 1) End If GetCertNameValue = strFieldValue End If End Function Dim strIssuer As String Dim strCompanyName As String strIssuer = FileTransfer1.CertificateIssuer If Len(strIssuer) = 0 Then MsgBox "A secure connection has not been established" Else strCompanyName = GetCertNameValue(strIssuer, "O") MsgBox "This certificate was issued by " & strCompanyName End If See Also
|
||||||||||||||||
Copyright © 2024 Catalyst Development Corporation. All rights reserved. |