什么是DN(Distinguished Names)

原文地址:http://lesca.me/archives/what-is-distinguished-names.html

--------------------------------------------------------------------------------------

Reference:

[1] Distinguished Names

版权声明 » LDAP:什么是DN(Distinguished Names)

---------------------------------------------------------------------------------------

 

 

1. DN与RDN

在LDAP协议中,DN用于指向一个LDAP对象,DN由一系列RDN(relative distinguished names)组成,RDN之间用“逗号”隔开,它是一个键值对,格式为:

attribute=value

下表列出了常见的RDN属性的类型:

StringAttribute 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 characterDescriptionHex 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

 

posted @ 2014-09-05 09:46  jerain6312  阅读(1565)  评论(0)    收藏  举报