Oid2Register Method

Registers object identifier in the OID database, either, local or in Active Directory.


Namespace: SysadminsLV.PKI.Cryptography
Assembly: SysadminsLV.PKI.Win (in SysadminsLV.PKI.Win.dll) Version: (
public static Oid2 Register(
	string value,
	string friendlyName,
	OidGroup group,
	bool writeInDirectory,
	CultureInfo localeId,
	string cpsUrl = null


value  String
An object identifier value to register.
friendlyName  String
A friendly name associated with the object identifier.
group  OidGroup
Specifies the OID group where specified object identifier should be registered.
writeInDirectory  Boolean
Specifies, whether object is registered locally or in Active Directory.
localeId  CultureInfo
Specifies the locale ID. This parameter can be used to provide localized friendly name. This parameter can be used only when writeInDirectory is set to True in other cases it is silently ignored.
cpsUrl  String  (Optional)
Specifies the URL to a certificate practice statement (CPS) location.

Return Value

Registered object identifier.


Permissions: for this method to succeed, the caller must be a member of the local administrators group (if writeInDirectory is set to False) or be a member of Enterprise Admins group or has delegated write permissions on the OID container in Active Directory. OID container location is CN=OID, CN=Public Key Services, CN=Services,CN=Configuration, {Configuration naming context}.

A newly registered OID is not resolvable by an application immediately. You may need to restart an application to allow new OID lookup.

When writeInDirectory is set to True, group parameter is limited only to one of the following value: ApplicationPolicy,IssuancePolicy and CertificateTemplate. Other OID groups are not allowed to be stored in Active Directory.


ArgumentNullExceptionvalue and/or friendlyName is null or empty.
ArgumentException Specified OID group is not supported. See Remarks section for more details.
InvalidDataExceptionvalue parameter is not object idnetifier value.
NotSupportedException A caller chose OID registration in Active Directory, however, the current computer is not a member of any Active Directory domain.
InvalidOperationException An object identifier is already registered.

See Also