Returns information about the organization that issued the
server certificate.
Syntax
object.CertificateIssuer
The object is an expression that evaluates to an InternetMail
object. The property returns a string value.
Remarks
The CertificateIssuer property returns a string that
contains information about the organization that issued the server
certificate. The string value is a comma separated list of tagged
name and value pairs. In the nomenclature of the X.500 standard,
each of these pairs are called a relative distinguished name (RDN),
and when concatenated together, forms the issuer's distinguished
name (DN). For example:
C=US, O="RSA Data Security, Inc.", OU=Secure Server
Certification Authority
To obtain a specific value, such as the name of the issuer or
the issuer's country, the application must parse the string
returned by this property. Some of the common tokens used in the
distinguished name are:
| Name |
Desciption |
| C |
The ISO standard two character
country code |
| S |
The name of the state or
province |
| L |
The name of the city or
locality |
| O |
The name of the company or
organization |
| OU |
The name of the department or
organizational unit |
| CN |
The common name; with X.509
certificates, this is the domain name of the site the certificate
was issued for |
This property will return an empty string if a secure connection
has not been established with the server.
Example
The following example demonstrates how to extract the value of a
relative distinguished name token:
Function GetCertNameValue(ByVal strValue As String, ByVal strFieldName As String) As String
Dim strFieldValue As String
Dim cchValue As Long
Dim cchFieldName As Long
Dim nOffset As Long
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
strFieldValue = Right(strValue, cchValue - (nOffset + cchFieldName))
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 nOffset > 0 Then
strFieldValue = Left(strFieldValue, nOffset - 1)
End If
GetCertNameValue = strFieldValue
End If
End Function
This function could then be used to return the name of the
company who issued the server certificate:
Dim strIssuer As String
Dim strCompanyName As String
strIssuer = InternetMail1.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
Data Type
String
See Also
CertificateExpires
Property, CertificateIssued
Property, CertificateStatus
Property, CertificateSubject
Property, Secure Property
|