SecureBlackbox 16: How do I change the order of RDN elements or control their appearance in the X509IssuerName and/or X509SubjectName elements?


There is a global variable RDNDescriptorMap in the SBXMLSec unit/namespace that controls the order.

For example if the original order is

C=EU, O=EldoS, OU=EldoS 1 EU

but we want to get the same order that the .NET framework generates, below,

OU=EldoS 1 EU, O=EldoS, C=EU

add the following line:

C# code:

SBXMLSec.Unit.RDNDescriptorMap.CompatibilityMode = SBXMLSec.TElXMLRDNCompatibilityMode.DotNET; // default value is TElXMLRDNCompatibilityMode.RFC

Delphi code:

SBXMLSec.RDNDescriptorMap.CompatibilityMode = cmDotNET; // default value is cmRFC

To change the descriptor name from “E” to “EMAIL”, use the following code:

RDNDescriptorMap.ClearOID(SB_CERT_OID_EMAIL); RDNDescriptorMap.Add(SB_CERT_OID_EMAIL, "EMAIL"); RDNDescriptorMap.Add(SB_CERT_OID_EMAIL, "E"); // second value works as an alias for parsing

We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.