X509AlternativeName(X509AlternativeNamesEnum, Object) Constructor

Initializes a new instance of the X509AlternativeName class by using alternative name type and alternative name value.

Definition

Namespace: SysadminsLV.PKI.Cryptography.X509Certificates
Assembly: SysadminsLV.PKI (in SysadminsLV.PKI.dll) Version: 4.0.1
C#
public X509AlternativeName(
	X509AlternativeNamesEnum type,
	Object value
)

Parameters

type  X509AlternativeNamesEnum
Specifies the type of the alternative name contained in the value parameter.
value  Object
Specifies the alternative name value. For acceptable value types see Remarks section.

Remarks

The following table defines alternative name type and value type mappings:
Alternative Name TypeValue Type
OtherNameNot supported in this constructor.
Rfc822NameThe value must be a string.
DnsNameThe value must be a string.
DirectoryName Can be a string that represents a X.500 distinguished name, or a X500DistinguishedName object.
URLCan be a string that represents an absolute or relative URL or a Uri object.
IpAddress

Must be a string that represents either, IPv4 or IPv6 address. For IPv6 address shortcuts are allowed (for example, ::1).

For X.509 Name Constraints certificate extension purposes, you must provide either, IPv4 or IPv6 address with network mask. In this case, network mask must be specified as the number of bits held by mask after a slash character. For example, IPv4 network "192.168.5.0" with network mask "255.255.255.0" must be passed as "192.168.5.0/24". The same syntax is used for IPv6 networks. To specify individual IP address, network mask bust be set to 32 for IPv4 addresses and 128 for IPv6 addresses.

RegisteredId Can be a string that represents a registered in the IANA (Internet Assigned Numbers Authority) or ISO (International Standards Organization) object identifier, or an Oid object or Guid object that contains registered object identifier.
Guid Can be a string that represents a globally unique identifier and should identify a server to the Active Directory replication system as a domain controller or an Oid object.
UserPrincipalName Must be a string that is a user logon name in email address format.
For compatibility with Name Constraints extension, null value can be passed for any name type except IPAddress name type. For IPAddress name type, global IP subnet must be used instead of empty value. For example, "0.0.0.0/0".

Exceptions

InvalidOperationException The constructor cannot be used for OtherName type.
ArgumentException The value does not fall within the expected type. For acceptable value types see Remarks section.

See Also