I have come across two different ways of encoding multiple OUs. One is to list the multiple OUs at the same level as other identifier, such as
SEQUENCE {
SET {
SEQUENCE {
OBJECT IDENTIFIER commonName (2 5 4 3)
PrintableString 'tester'
}
}
SET {
SEQUENCE {
OBJECT IDENTIFIER organizationalUnitName (2 5 4 11)
UTF8String 'department1'
}
}
SET {
SEQUENCE {
OBJECT IDENTIFIER organizationalUnitName (2 5 4 11)
UTF8String 'org1'
}
}
}
Another is to embed the OUs as a list as follow
SEQUENCE {
SET {
SEQUENCE {
OBJECT IDENTIFIER commonName (2 5 4 3)
PrintableString 'tester'
}
}
SET {
SEQUENCE {
OBJECT IDENTIFIER organizationalUnitName (2 5 4 11)
PrintableString 'department1'
}
SEQUENCE {
OBJECT IDENTIFIER organizationalUnitName (2 5 4 11)
PrintableString 'org1'
}
}
}
And some tools would decode the 2nd encoding as 1 OU only, representing it as follow
organizationalUnitName = department1 + organizationalUnitName = org1
I am just wondering which way is the better, or more common way to encode multiple OUs.