Passa al contenuto principale

3. Analisi di una stringa per ricostruire un nome distinto

La rappresentazione in formato stringa dei Distinguished Name è limitata ai caratteri Unicode [Unicode] codificati in UTF-8 [RFC3629]. La struttura di questa rappresentazione in formato stringa è specificata mediante la seguente grammatica Augmented BNF [RFC4234]:

distinguishedName = [ relativeDistinguishedName
*( COMMA relativeDistinguishedName ) ]
relativeDistinguishedName = attributeTypeAndValue
*( PLUS attributeTypeAndValue )
attributeTypeAndValue = attributeType EQUALS attributeValue
attributeType = descr / numericoid
attributeValue = string / hexstring

; I seguenti caratteri devono essere sottoposti a escape quando
; compaiono nel valore da codificare: ESC, uno di <escaped>,
; SHARP o SPACE iniziale, SPACE finale e NULL.
string = [ ( leadchar / pair ) [ *( stringchar / pair )
( trailchar / pair ) ] ]

leadchar = LUTF1 / UTFMB
LUTF1 = %x01-1F / %x21 / %x24-2A / %x2D-3A /
%x3D / %x3F-5B / %x5D-7F

trailchar = TUTF1 / UTFMB
TUTF1 = %x01-1F / %x21 / %x23-2A / %x2D-3A /
%x3D / %x3F-5B / %x5D-7F

stringchar = SUTF1 / UTFMB
SUTF1 = %x01-21 / %x23-2A / %x2D-3A /
%x3D / %x3F-5B / %x5D-7F

pair = ESC ( ESC / special / hexpair )
special = escaped / SPACE / SHARP / EQUALS
escaped = DQUOTE / PLUS / COMMA / SEMI / LANGLE / RANGLE
hexstring = SHARP 1*hexpair
hexpair = HEX HEX

dove le produzioni , , , , , , , , , , , , , e sono definite in [RFC4512].

Ogni , sia esso un o un , si riferisce a un tipo di attributo di un'asserzione di valore di attributo (AVA). Il è seguito da un e da un . L' è in forma o .

Se in forma , è possibile ottenere un valore asserito nella rappresentazione in formato stringa LDAP sostituendo (da sinistra a destra, in modo non ricorsivo) ogni che compare nella come segue:

sostituire <ESC><ESC> con <ESC>;
sostituire <ESC><special> con <special>;
sostituire <ESC><hexpair> con l'ottetto indicato dal <hexpair>.

Se in forma , è possibile ottenere una rappresentazione BER convertendo ogni dell' nell'ottetto indicato dal .

Per un nome distinto relativo vi è una o più asserzioni di valore di attributo, separate da .

Per un nome distinto vi sono zero o più nomi distinti relativi, separati da .

Le implementazioni DEVONO (MUST) riconoscere le stringhe di nome AttributeType (descrittori) elencate nella tabella seguente, ma POSSONO (MAY) riconoscerne altre.

StringaX.500 AttributeType
CNcommonName (2.5.4.3)
LlocalityName (2.5.4.7)
STstateOrProvinceName (2.5.4.8)
OorganizationName (2.5.4.10)
OUorganizationalUnitName (2.5.4.11)
CcountryName (2.5.4.6)
STREETstreetAddress (2.5.4.9)
DCdomainComponent (0.9.2342.19200300.100.1.25)
UIDuserId (0.9.2342.19200300.100.1.1)

Questi tipi di attributo sono descritti in [RFC4519].

Le implementazioni POSSONO (MAY) riconoscere altre rappresentazioni in formato stringa dei DN. Tuttavia, poiché non è richiesto che le rappresentazioni alternative in formato stringa dei DN siano riconosciute (né, in tal caso, come), le implementazioni DOVREBBERO (SHOULD) generare stringhe di DN solo conformemente alla sezione 2 di questo documento.