什么是DN(Distinguished Names)
原文地址:http://lesca.me/archives/what-is-distinguished-names.html
--------------------------------------------------------------------------------------
Reference:
版权声明 » LDAP:什么是DN(Distinguished Names)
-
作者:lesca 最后更新:July 3, 2012
-
本博客所有内容均在《“署名-非商业用途-保持一致”的创作共用协议》下发布
-
全文转载,必须包含本版权信息;部分转载或引用,请注明作者署名与文章出处
-
本文链接:http://lesca.me/archives/what-is-distinguished-names.html
---------------------------------------------------------------------------------------
1. DN与RDN
在LDAP协议中,DN用于指向一个LDAP对象,DN由一系列RDN(relative distinguished names)组成,RDN之间用“逗号”隔开,它是一个键值对,格式为:
attribute=value
下表列出了常见的RDN属性的类型:
| String | Attribute type |
|---|---|
| DC | domainComponent |
| CN | commonName |
| OU | organizationalUnitName |
| O | organizationName |
| STREET | streetAddress |
| L | localityName |
| ST | stateOrProvinceName |
| C | countryName |
| UID | userid |
以下是一些常见的DN:
CN=Users,DC=lesca,DC=bit
CN=Jeff Smith,OU=Sales,DC=Fabrikam,DC=COM
2. DN中的保留字符与转义
下表列出了DN中不能使用的保留字符,它们有特殊用途:
| Reserved character | Description | Hex value |
|---|---|---|
| space or # character at the beginning of a string | ||
| space character at the end of a string | ||
| , | comma | 0x2C |
| + | plus sign | 0x2B |
| “ | double quote | 0×22 |
| \ | backslash | 0x5C |
| < | left angle bracket | 0x3C |
| > | right angle bracket | 0x3E |
| ; | semicolon | 0x3B |
| LF | line feed | 0x0A |
| CR | carriage return | 0x0D |
| = | equals sign | 0x3D |
| / | forwards slash | 0x2F |
例如,如果在DN中含有“逗号”需要转义:
CN=Litware,OU=Docs\, Adatum,DC=Fabrikam,DC=COM
又如下面的DN含有“换行符”(CR, 0X0d):
CN=Before\0DAfter,OU=Test,DC=North America,DC=Fabrikam,DC=COM

浙公网安备 33010602011771号