namespace Xilium.CefGlue
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
using Xilium.CefGlue.Interop;
///
/// Class representing the issuer or subject field of an X.509 certificate.
///
public sealed unsafe partial class CefX509CertPrincipal
{
///
/// Returns a name that can be used to represent the issuer. It tries in this
/// order: Common Name (CN), Organization Name (O) and Organizational Unit
/// Name (OU) and returns the first non-empty one found.
///
public string GetDisplayName()
{
return cef_string_userfree.ToString(
cef_x509cert_principal_t.get_display_name(_self)
);
}
///
/// Returns the common name.
///
public string GetCommonName()
{
return cef_string_userfree.ToString(
cef_x509cert_principal_t.get_common_name(_self)
);
}
///
/// Returns the locality name.
///
public string GetLocalityName()
{
return cef_string_userfree.ToString(
cef_x509cert_principal_t.get_locality_name(_self)
);
}
///
/// Returns the state or province name.
///
public string GetStateOrProvinceName()
{
return cef_string_userfree.ToString(
cef_x509cert_principal_t.get_state_or_province_name(_self)
);
}
///
/// Returns the country name.
///
public string GetCountryName()
{
return cef_string_userfree.ToString(
cef_x509cert_principal_t.get_country_name(_self)
);
}
///
/// Retrieve the list of street addresses.
///
public string[] GetStreetAddresses()
{
cef_string_list* n_result = libcef.string_list_alloc();
cef_x509cert_principal_t.get_street_addresses(_self, n_result);
var result = cef_string_list.ToArray(n_result);
libcef.string_list_free(n_result);
return result;
}
///
/// Retrieve the list of organization names.
///
public string[] GetOrganizationNames()
{
cef_string_list* n_result = libcef.string_list_alloc();
cef_x509cert_principal_t.get_organization_names(_self, n_result);
var result = cef_string_list.ToArray(n_result);
libcef.string_list_free(n_result);
return result;
}
///
/// Retrieve the list of organization unit names.
///
public string[] GetOrganizationUnitNames()
{
cef_string_list* n_result = libcef.string_list_alloc();
cef_x509cert_principal_t.get_organization_unit_names(_self, n_result);
var result = cef_string_list.ToArray(n_result);
libcef.string_list_free(n_result);
return result;
}
///
/// Retrieve the list of domain components.
///
public string[] GetDomainComponents()
{
cef_string_list* n_result = libcef.string_list_alloc();
cef_x509cert_principal_t.get_domain_components(_self, n_result);
var result = cef_string_list.ToArray(n_result);
libcef.string_list_free(n_result);
return result;
}
}
}