Passed
Push — master ( 2b203b...5942af )
by Joni
02:33
created
lib/X501/StringPrep/PrepareStep.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,11 +10,11 @@
 block discarded – undo
10 10
  */
11 11
 interface PrepareStep
12 12
 {
13
-    /**
14
-     * Apply string preparation step.
15
-     *
16
-     * @param string $string String to prepare
17
-     * @return string Prepared string
18
-     */
19
-    public function apply($string);
13
+	/**
14
+	 * Apply string preparation step.
15
+	 *
16
+	 * @param string $string String to prepare
17
+	 * @return string Prepared string
18
+	 */
19
+	public function apply($string);
20 20
 }
Please login to merge, or discard this patch.
lib/X501/StringPrep/ProhibitStep.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -10,16 +10,16 @@
 block discarded – undo
10 10
  */
11 11
 class ProhibitStep implements PrepareStep
12 12
 {
13
-    /**
14
-     *
15
-     * @throws \UnexpectedValueException If string contains prohibited
16
-     *         characters
17
-     * @param string $string UTF-8 encoded string
18
-     * @return string
19
-     */
20
-    public function apply($string)
21
-    {
22
-        // @todo Implement
23
-        return $string;
24
-    }
13
+	/**
14
+	 *
15
+	 * @throws \UnexpectedValueException If string contains prohibited
16
+	 *         characters
17
+	 * @param string $string UTF-8 encoded string
18
+	 * @return string
19
+	 */
20
+	public function apply($string)
21
+	{
22
+		// @todo Implement
23
+		return $string;
24
+	}
25 25
 }
Please login to merge, or discard this patch.
lib/X501/StringPrep/TranscodeStep.php 2 patches
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -13,51 +13,51 @@
 block discarded – undo
13 13
  */
14 14
 class TranscodeStep implements PrepareStep
15 15
 {
16
-    /**
17
-     * ASN.1 type of the string.
18
-     *
19
-     * @var int $_type
20
-     */
21
-    protected $_type;
16
+	/**
17
+	 * ASN.1 type of the string.
18
+	 *
19
+	 * @var int $_type
20
+	 */
21
+	protected $_type;
22 22
     
23
-    /**
24
-     * Constructor.
25
-     *
26
-     * @param int $type ASN.1 type tag of the string
27
-     */
28
-    public function __construct($type)
29
-    {
30
-        $this->_type = $type;
31
-    }
23
+	/**
24
+	 * Constructor.
25
+	 *
26
+	 * @param int $type ASN.1 type tag of the string
27
+	 */
28
+	public function __construct($type)
29
+	{
30
+		$this->_type = $type;
31
+	}
32 32
     
33
-    /**
34
-     *
35
-     * @throws \LogicException If string type is not supported
36
-     * @param string $string String to prepare
37
-     * @return string UTF-8 encoded string
38
-     */
39
-    public function apply($string)
40
-    {
41
-        switch ($this->_type) {
42
-            // UTF-8 string as is
43
-            case Element::TYPE_UTF8_STRING:
44
-                return $string;
45
-            // PrintableString maps directly to UTF-8
46
-            case Element::TYPE_PRINTABLE_STRING:
47
-                return $string;
48
-            // UCS-2 to UTF-8
49
-            case Element::TYPE_BMP_STRING:
50
-                return mb_convert_encoding($string, "UTF-8", "UCS-2BE");
51
-            // UCS-4 to UTF-8
52
-            case Element::TYPE_UNIVERSAL_STRING:
53
-                return mb_convert_encoding($string, "UTF-8", "UCS-4BE");
54
-            // TeletexString mapping is a local matter.
55
-            // We take a shortcut here and encode it as a hexstring.
56
-            case Element::TYPE_T61_STRING:
57
-                $el = new T61String($string);
58
-                return "#" . bin2hex($el->toDER());
59
-        }
60
-        throw new \LogicException(
61
-            "Unsupported string type " . Element::tagToName($this->_type) . ".");
62
-    }
33
+	/**
34
+	 *
35
+	 * @throws \LogicException If string type is not supported
36
+	 * @param string $string String to prepare
37
+	 * @return string UTF-8 encoded string
38
+	 */
39
+	public function apply($string)
40
+	{
41
+		switch ($this->_type) {
42
+			// UTF-8 string as is
43
+			case Element::TYPE_UTF8_STRING:
44
+				return $string;
45
+			// PrintableString maps directly to UTF-8
46
+			case Element::TYPE_PRINTABLE_STRING:
47
+				return $string;
48
+			// UCS-2 to UTF-8
49
+			case Element::TYPE_BMP_STRING:
50
+				return mb_convert_encoding($string, "UTF-8", "UCS-2BE");
51
+			// UCS-4 to UTF-8
52
+			case Element::TYPE_UNIVERSAL_STRING:
53
+				return mb_convert_encoding($string, "UTF-8", "UCS-4BE");
54
+			// TeletexString mapping is a local matter.
55
+			// We take a shortcut here and encode it as a hexstring.
56
+			case Element::TYPE_T61_STRING:
57
+				$el = new T61String($string);
58
+				return "#" . bin2hex($el->toDER());
59
+		}
60
+		throw new \LogicException(
61
+			"Unsupported string type " . Element::tagToName($this->_type) . ".");
62
+	}
63 63
 }
Please login to merge, or discard this patch.
Switch Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -40,22 +40,22 @@
 block discarded – undo
40 40
     {
41 41
         switch ($this->_type) {
42 42
             // UTF-8 string as is
43
-            case Element::TYPE_UTF8_STRING:
44
-                return $string;
45
-            // PrintableString maps directly to UTF-8
46
-            case Element::TYPE_PRINTABLE_STRING:
47
-                return $string;
48
-            // UCS-2 to UTF-8
49
-            case Element::TYPE_BMP_STRING:
50
-                return mb_convert_encoding($string, "UTF-8", "UCS-2BE");
51
-            // UCS-4 to UTF-8
52
-            case Element::TYPE_UNIVERSAL_STRING:
53
-                return mb_convert_encoding($string, "UTF-8", "UCS-4BE");
54
-            // TeletexString mapping is a local matter.
55
-            // We take a shortcut here and encode it as a hexstring.
56
-            case Element::TYPE_T61_STRING:
57
-                $el = new T61String($string);
58
-                return "#" . bin2hex($el->toDER());
43
+        case Element::TYPE_UTF8_STRING:
44
+            return $string;
45
+        // PrintableString maps directly to UTF-8
46
+        case Element::TYPE_PRINTABLE_STRING:
47
+            return $string;
48
+        // UCS-2 to UTF-8
49
+        case Element::TYPE_BMP_STRING:
50
+            return mb_convert_encoding($string, "UTF-8", "UCS-2BE");
51
+        // UCS-4 to UTF-8
52
+        case Element::TYPE_UNIVERSAL_STRING:
53
+            return mb_convert_encoding($string, "UTF-8", "UCS-4BE");
54
+        // TeletexString mapping is a local matter.
55
+        // We take a shortcut here and encode it as a hexstring.
56
+        case Element::TYPE_T61_STRING:
57
+            $el = new T61String($string);
58
+            return "#" . bin2hex($el->toDER());
59 59
         }
60 60
         throw new \LogicException(
61 61
             "Unsupported string type " . Element::tagToName($this->_type) . ".");
Please login to merge, or discard this patch.
lib/X501/StringPrep/CheckBidiStep.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -10,14 +10,14 @@
 block discarded – undo
10 10
  */
11 11
 class CheckBidiStep implements PrepareStep
12 12
 {
13
-    /**
14
-     *
15
-     * @param string $string UTF-8 encoded string
16
-     * @return string
17
-     */
18
-    public function apply($string)
19
-    {
20
-        // @todo Implement
21
-        return $string;
22
-    }
13
+	/**
14
+	 *
15
+	 * @param string $string UTF-8 encoded string
16
+	 * @return string
17
+	 */
18
+	public function apply($string)
19
+	{
20
+		// @todo Implement
21
+		return $string;
22
+	}
23 23
 }
Please login to merge, or discard this patch.
lib/X501/ASN1/AttributeType.php 2 patches
Indentation   +422 added lines, -422 removed lines patch added patch discarded remove patch
@@ -15,439 +15,439 @@
 block discarded – undo
15 15
  */
16 16
 class AttributeType
17 17
 {
18
-    // OID's from 2.5.4 arc
19
-    const OID_OBJECT_CLASS = "2.5.4.0";
20
-    const OID_ALIASED_ENTRY_NAME = "2.5.4.1";
21
-    const OID_KNOWLEDGE_INFORMATION = "2.5.4.2";
22
-    const OID_COMMON_NAME = "2.5.4.3";
23
-    const OID_SURNAME = "2.5.4.4";
24
-    const OID_SERIAL_NUMBER = "2.5.4.5";
25
-    const OID_COUNTRY_NAME = "2.5.4.6";
26
-    const OID_LOCALITY_NAME = "2.5.4.7";
27
-    const OID_STATE_OR_PROVINCE_NAME = "2.5.4.8";
28
-    const OID_STREET_ADDRESS = "2.5.4.9";
29
-    const OID_ORGANIZATION_NAME = "2.5.4.10";
30
-    const OID_ORGANIZATIONAL_UNIT_NAME = "2.5.4.11";
31
-    const OID_TITLE = "2.5.4.12";
32
-    const OID_DESCRIPTION = "2.5.4.13";
33
-    const OID_SEARCH_GUIDE = "2.5.4.14";
34
-    const OID_BUSINESS_CATEGORY = "2.5.4.15";
35
-    const OID_POSTAL_ADDRESS = "2.5.4.16";
36
-    const OID_POSTAL_CODE = "2.5.4.17";
37
-    const OID_POST_OFFICE_BOX = "2.5.4.18";
38
-    const OID_PHYSICAL_DELIVERY_OFFICE_NAME = "2.5.4.19";
39
-    const OID_TELEPHONE_NUMBER = "2.5.4.20";
40
-    const OID_TELEX_NUMBER = "2.5.4.21";
41
-    const OID_TELETEX_TERMINAL_IDENTIFIER = "2.5.4.22";
42
-    const OID_FACSIMILE_TELEPHONE_NUMBER = "2.5.4.23";
43
-    const OID_X121_ADDRESS = "2.5.4.24";
44
-    const OID_INTERNATIONAL_ISDN_NUMBER = "2.5.4.25";
45
-    const OID_REGISTERED_ADDRESS = "2.5.4.26";
46
-    const OID_DESTINATION_INDICATOR = "2.5.4.27";
47
-    const OID_PREFERRED_DELIVERY_METHOD = "2.5.4.28";
48
-    const OID_PRESENTATION_ADDRESS = "2.5.4.29";
49
-    const OID_SUPPORTED_APPLICATION_CONTEXT = "2.5.4.30";
50
-    const OID_MEMBER = "2.5.4.31";
51
-    const OID_OWNER = "2.5.4.32";
52
-    const OID_ROLE_OCCUPANT = "2.5.4.33";
53
-    const OID_SEE_ALSO = "2.5.4.34";
54
-    const OID_USER_PASSWORD = "2.5.4.35";
55
-    const OID_USER_CERTIFICATE = "2.5.4.36";
56
-    const OID_CA_CERTIFICATE = "2.5.4.37";
57
-    const OID_AUTHORITY_REVOCATION_LIST = "2.5.4.38";
58
-    const OID_CERTIFICATE_REVOCATION_LIST = "2.5.4.39";
59
-    const OID_CROSS_CERTIFICATE_PAIR = "2.5.4.40";
60
-    const OID_NAME = "2.5.4.41";
61
-    const OID_GIVEN_NAME = "2.5.4.42";
62
-    const OID_INITIALS = "2.5.4.43";
63
-    const OID_GENERATION_QUALIFIER = "2.5.4.44";
64
-    const OID_UNIQUE_IDENTIFIER = "2.5.4.45";
65
-    const OID_DN_QUALIFIER = "2.5.4.46";
66
-    const OID_ENHANCED_SEARCH_GUIDE = "2.5.4.47";
67
-    const OID_PROTOCOL_INFORMATION = "2.5.4.48";
68
-    const OID_DISTINGUISHED_NAME = "2.5.4.49";
69
-    const OID_UNIQUE_MEMBER = "2.5.4.50";
70
-    const OID_HOUSE_IDENTIFIER = "2.5.4.51";
71
-    const OID_SUPPORTED_ALGORITHMS = "2.5.4.52";
72
-    const OID_DELTA_REVOCATION_LIST = "2.5.4.53";
73
-    const OID_DMD_NAME = "2.5.4.54";
74
-    const OID_CLEARANCE = "2.5.4.55";
75
-    const OID_DEFAULT_DIR_QOP = "2.5.4.56";
76
-    const OID_ATTRIBUTE_INTEGRITY_INFO = "2.5.4.57";
77
-    const OID_ATTRIBUTE_CERTIFICATE = "2.5.4.58";
78
-    const OID_ATTRIBUTE_CERTIFICATE_REVOCATION_LIST = "2.5.4.59";
79
-    const OID_CONF_KEY_INFO = "2.5.4.60";
80
-    const OID_AA_CERTIFICATE = "2.5.4.61";
81
-    const OID_ATTRIBUTE_DESCRIPTOR_CERTIFICATE = "2.5.4.62";
82
-    const OID_ATTRIBUTE_AUTHORITY_REVOCATION_LIST = "2.5.4.63";
83
-    const OID_FAMILY_INFORMATION = "2.5.4.64";
84
-    const OID_PSEUDONYM = "2.5.4.65";
85
-    const OID_COMMUNICATIONS_SERVICE = "2.5.4.66";
86
-    const OID_COMMUNICATIONS_NETWORK = "2.5.4.67";
87
-    const OID_CERTIFICATION_PRACTICE_STMT = "2.5.4.68";
88
-    const OID_CERTIFICATE_POLICY = "2.5.4.69";
89
-    const OID_PKI_PATH = "2.5.4.70";
90
-    const OID_PRIV_POLICY = "2.5.4.71";
91
-    const OID_ROLE = "2.5.4.72";
92
-    const OID_DELEGATION_PATH = "2.5.4.73";
93
-    const OID_PROT_PRIV_POLICY = "2.5.4.74";
94
-    const OID_XML_PRIVILEGE_INFO = "2.5.4.75";
95
-    const OID_XML_PRIV_POLICY = "2.5.4.76";
96
-    const OID_UUID_PAIR = "2.5.4.77";
97
-    const OID_TAG_OID = "2.5.4.78";
98
-    const OID_UII_FORMAT = "2.5.4.79";
99
-    const OID_UII_IN_URH = "2.5.4.80";
100
-    const OID_CONTENT_URL = "2.5.4.81";
101
-    const OID_PERMISSION = "2.5.4.82";
102
-    const OID_URI = "2.5.4.83";
103
-    const OID_PWD_ATTRIBUTE = "2.5.4.84";
104
-    const OID_USER_PWD = "2.5.4.85";
105
-    const OID_URN = "2.5.4.86";
106
-    const OID_URL = "2.5.4.87";
107
-    const OID_UTM_COORDINATES = "2.5.4.88";
108
-    const OID_URNC = "2.5.4.89";
109
-    const OID_UII = "2.5.4.90";
110
-    const OID_EPC = "2.5.4.91";
111
-    const OID_TAG_AFI = "2.5.4.92";
112
-    const OID_EPC_FORMAT = "2.5.4.93";
113
-    const OID_EPC_IN_URN = "2.5.4.94";
114
-    const OID_LDAP_URL = "2.5.4.95";
115
-    const OID_TAG_LOCATION = "2.5.4.96";
116
-    const OID_ORGANIZATION_IDENTIFIER = "2.5.4.97";
18
+	// OID's from 2.5.4 arc
19
+	const OID_OBJECT_CLASS = "2.5.4.0";
20
+	const OID_ALIASED_ENTRY_NAME = "2.5.4.1";
21
+	const OID_KNOWLEDGE_INFORMATION = "2.5.4.2";
22
+	const OID_COMMON_NAME = "2.5.4.3";
23
+	const OID_SURNAME = "2.5.4.4";
24
+	const OID_SERIAL_NUMBER = "2.5.4.5";
25
+	const OID_COUNTRY_NAME = "2.5.4.6";
26
+	const OID_LOCALITY_NAME = "2.5.4.7";
27
+	const OID_STATE_OR_PROVINCE_NAME = "2.5.4.8";
28
+	const OID_STREET_ADDRESS = "2.5.4.9";
29
+	const OID_ORGANIZATION_NAME = "2.5.4.10";
30
+	const OID_ORGANIZATIONAL_UNIT_NAME = "2.5.4.11";
31
+	const OID_TITLE = "2.5.4.12";
32
+	const OID_DESCRIPTION = "2.5.4.13";
33
+	const OID_SEARCH_GUIDE = "2.5.4.14";
34
+	const OID_BUSINESS_CATEGORY = "2.5.4.15";
35
+	const OID_POSTAL_ADDRESS = "2.5.4.16";
36
+	const OID_POSTAL_CODE = "2.5.4.17";
37
+	const OID_POST_OFFICE_BOX = "2.5.4.18";
38
+	const OID_PHYSICAL_DELIVERY_OFFICE_NAME = "2.5.4.19";
39
+	const OID_TELEPHONE_NUMBER = "2.5.4.20";
40
+	const OID_TELEX_NUMBER = "2.5.4.21";
41
+	const OID_TELETEX_TERMINAL_IDENTIFIER = "2.5.4.22";
42
+	const OID_FACSIMILE_TELEPHONE_NUMBER = "2.5.4.23";
43
+	const OID_X121_ADDRESS = "2.5.4.24";
44
+	const OID_INTERNATIONAL_ISDN_NUMBER = "2.5.4.25";
45
+	const OID_REGISTERED_ADDRESS = "2.5.4.26";
46
+	const OID_DESTINATION_INDICATOR = "2.5.4.27";
47
+	const OID_PREFERRED_DELIVERY_METHOD = "2.5.4.28";
48
+	const OID_PRESENTATION_ADDRESS = "2.5.4.29";
49
+	const OID_SUPPORTED_APPLICATION_CONTEXT = "2.5.4.30";
50
+	const OID_MEMBER = "2.5.4.31";
51
+	const OID_OWNER = "2.5.4.32";
52
+	const OID_ROLE_OCCUPANT = "2.5.4.33";
53
+	const OID_SEE_ALSO = "2.5.4.34";
54
+	const OID_USER_PASSWORD = "2.5.4.35";
55
+	const OID_USER_CERTIFICATE = "2.5.4.36";
56
+	const OID_CA_CERTIFICATE = "2.5.4.37";
57
+	const OID_AUTHORITY_REVOCATION_LIST = "2.5.4.38";
58
+	const OID_CERTIFICATE_REVOCATION_LIST = "2.5.4.39";
59
+	const OID_CROSS_CERTIFICATE_PAIR = "2.5.4.40";
60
+	const OID_NAME = "2.5.4.41";
61
+	const OID_GIVEN_NAME = "2.5.4.42";
62
+	const OID_INITIALS = "2.5.4.43";
63
+	const OID_GENERATION_QUALIFIER = "2.5.4.44";
64
+	const OID_UNIQUE_IDENTIFIER = "2.5.4.45";
65
+	const OID_DN_QUALIFIER = "2.5.4.46";
66
+	const OID_ENHANCED_SEARCH_GUIDE = "2.5.4.47";
67
+	const OID_PROTOCOL_INFORMATION = "2.5.4.48";
68
+	const OID_DISTINGUISHED_NAME = "2.5.4.49";
69
+	const OID_UNIQUE_MEMBER = "2.5.4.50";
70
+	const OID_HOUSE_IDENTIFIER = "2.5.4.51";
71
+	const OID_SUPPORTED_ALGORITHMS = "2.5.4.52";
72
+	const OID_DELTA_REVOCATION_LIST = "2.5.4.53";
73
+	const OID_DMD_NAME = "2.5.4.54";
74
+	const OID_CLEARANCE = "2.5.4.55";
75
+	const OID_DEFAULT_DIR_QOP = "2.5.4.56";
76
+	const OID_ATTRIBUTE_INTEGRITY_INFO = "2.5.4.57";
77
+	const OID_ATTRIBUTE_CERTIFICATE = "2.5.4.58";
78
+	const OID_ATTRIBUTE_CERTIFICATE_REVOCATION_LIST = "2.5.4.59";
79
+	const OID_CONF_KEY_INFO = "2.5.4.60";
80
+	const OID_AA_CERTIFICATE = "2.5.4.61";
81
+	const OID_ATTRIBUTE_DESCRIPTOR_CERTIFICATE = "2.5.4.62";
82
+	const OID_ATTRIBUTE_AUTHORITY_REVOCATION_LIST = "2.5.4.63";
83
+	const OID_FAMILY_INFORMATION = "2.5.4.64";
84
+	const OID_PSEUDONYM = "2.5.4.65";
85
+	const OID_COMMUNICATIONS_SERVICE = "2.5.4.66";
86
+	const OID_COMMUNICATIONS_NETWORK = "2.5.4.67";
87
+	const OID_CERTIFICATION_PRACTICE_STMT = "2.5.4.68";
88
+	const OID_CERTIFICATE_POLICY = "2.5.4.69";
89
+	const OID_PKI_PATH = "2.5.4.70";
90
+	const OID_PRIV_POLICY = "2.5.4.71";
91
+	const OID_ROLE = "2.5.4.72";
92
+	const OID_DELEGATION_PATH = "2.5.4.73";
93
+	const OID_PROT_PRIV_POLICY = "2.5.4.74";
94
+	const OID_XML_PRIVILEGE_INFO = "2.5.4.75";
95
+	const OID_XML_PRIV_POLICY = "2.5.4.76";
96
+	const OID_UUID_PAIR = "2.5.4.77";
97
+	const OID_TAG_OID = "2.5.4.78";
98
+	const OID_UII_FORMAT = "2.5.4.79";
99
+	const OID_UII_IN_URH = "2.5.4.80";
100
+	const OID_CONTENT_URL = "2.5.4.81";
101
+	const OID_PERMISSION = "2.5.4.82";
102
+	const OID_URI = "2.5.4.83";
103
+	const OID_PWD_ATTRIBUTE = "2.5.4.84";
104
+	const OID_USER_PWD = "2.5.4.85";
105
+	const OID_URN = "2.5.4.86";
106
+	const OID_URL = "2.5.4.87";
107
+	const OID_UTM_COORDINATES = "2.5.4.88";
108
+	const OID_URNC = "2.5.4.89";
109
+	const OID_UII = "2.5.4.90";
110
+	const OID_EPC = "2.5.4.91";
111
+	const OID_TAG_AFI = "2.5.4.92";
112
+	const OID_EPC_FORMAT = "2.5.4.93";
113
+	const OID_EPC_IN_URN = "2.5.4.94";
114
+	const OID_LDAP_URL = "2.5.4.95";
115
+	const OID_TAG_LOCATION = "2.5.4.96";
116
+	const OID_ORGANIZATION_IDENTIFIER = "2.5.4.97";
117 117
     
118
-    // Miscellany attribute OID's
119
-    const OID_CLEARANCE_X501 = "2.5.1.5.55";
118
+	// Miscellany attribute OID's
119
+	const OID_CLEARANCE_X501 = "2.5.1.5.55";
120 120
     
121
-    /**
122
-     * Default ASN.1 string types for attributes.
123
-     *
124
-     * Attributes not mapped here shall use UTF8String as a default type.
125
-     *
126
-     * @internal
127
-     *
128
-     * @var array
129
-     */
130
-    const MAP_ATTR_TO_STR_TYPE = array(
131
-        /* @formatter:off */
132
-        self::OID_DN_QUALIFIER => Element::TYPE_PRINTABLE_STRING, 
133
-        self::OID_COUNTRY_NAME => Element::TYPE_PRINTABLE_STRING, 
134
-        self::OID_SERIAL_NUMBER => Element::TYPE_PRINTABLE_STRING
135
-        /* @formatter:on */
136
-    );
121
+	/**
122
+	 * Default ASN.1 string types for attributes.
123
+	 *
124
+	 * Attributes not mapped here shall use UTF8String as a default type.
125
+	 *
126
+	 * @internal
127
+	 *
128
+	 * @var array
129
+	 */
130
+	const MAP_ATTR_TO_STR_TYPE = array(
131
+		/* @formatter:off */
132
+		self::OID_DN_QUALIFIER => Element::TYPE_PRINTABLE_STRING, 
133
+		self::OID_COUNTRY_NAME => Element::TYPE_PRINTABLE_STRING, 
134
+		self::OID_SERIAL_NUMBER => Element::TYPE_PRINTABLE_STRING
135
+		/* @formatter:on */
136
+	);
137 137
     
138
-    /**
139
-     * OID to attribute names mapping.
140
-     *
141
-     * First name is the primary name. If there's more than one name, others may
142
-     * be used as an alias.
143
-     *
144
-     * Generated using ldap-attribs.py.
145
-     *
146
-     * @internal
147
-     *
148
-     * @var array
149
-     */
150
-    const MAP_OID_TO_NAME = array(
151
-        /* @formatter:off */
152
-        "0.9.2342.19200300.100.1.1" => ["uid", "userid"],
153
-        "0.9.2342.19200300.100.1.2" => ["textEncodedORAddress"],
154
-        "0.9.2342.19200300.100.1.3" => ["mail", "rfc822Mailbox"],
155
-        "0.9.2342.19200300.100.1.4" => ["info"],
156
-        "0.9.2342.19200300.100.1.5" => ["drink", "favouriteDrink"],
157
-        "0.9.2342.19200300.100.1.6" => ["roomNumber"],
158
-        "0.9.2342.19200300.100.1.7" => ["photo"],
159
-        "0.9.2342.19200300.100.1.8" => ["userClass"],
160
-        "0.9.2342.19200300.100.1.9" => ["host"],
161
-        "0.9.2342.19200300.100.1.10" => ["manager"],
162
-        "0.9.2342.19200300.100.1.11" => ["documentIdentifier"],
163
-        "0.9.2342.19200300.100.1.12" => ["documentTitle"],
164
-        "0.9.2342.19200300.100.1.13" => ["documentVersion"],
165
-        "0.9.2342.19200300.100.1.14" => ["documentAuthor"],
166
-        "0.9.2342.19200300.100.1.15" => ["documentLocation"],
167
-        "0.9.2342.19200300.100.1.20" => ["homePhone", "homeTelephoneNumber"],
168
-        "0.9.2342.19200300.100.1.21" => ["secretary"],
169
-        "0.9.2342.19200300.100.1.22" => ["otherMailbox"],
170
-        "0.9.2342.19200300.100.1.25" => ["dc", "domainComponent"],
171
-        "0.9.2342.19200300.100.1.26" => ["aRecord"],
172
-        "0.9.2342.19200300.100.1.27" => ["mDRecord"],
173
-        "0.9.2342.19200300.100.1.28" => ["mXRecord"],
174
-        "0.9.2342.19200300.100.1.29" => ["nSRecord"],
175
-        "0.9.2342.19200300.100.1.30" => ["sOARecord"],
176
-        "0.9.2342.19200300.100.1.31" => ["cNAMERecord"],
177
-        "0.9.2342.19200300.100.1.37" => ["associatedDomain"],
178
-        "0.9.2342.19200300.100.1.38" => ["associatedName"],
179
-        "0.9.2342.19200300.100.1.39" => ["homePostalAddress"],
180
-        "0.9.2342.19200300.100.1.40" => ["personalTitle"],
181
-        "0.9.2342.19200300.100.1.41" => ["mobile", "mobileTelephoneNumber"],
182
-        "0.9.2342.19200300.100.1.42" => ["pager", "pagerTelephoneNumber"],
183
-        "0.9.2342.19200300.100.1.43" => ["co", "friendlyCountryName"],
184
-        "0.9.2342.19200300.100.1.44" => ["uniqueIdentifier"],
185
-        "0.9.2342.19200300.100.1.45" => ["organizationalStatus"],
186
-        "0.9.2342.19200300.100.1.46" => ["janetMailbox"],
187
-        "0.9.2342.19200300.100.1.47" => ["mailPreferenceOption"],
188
-        "0.9.2342.19200300.100.1.48" => ["buildingName"],
189
-        "0.9.2342.19200300.100.1.49" => ["dSAQuality"],
190
-        "0.9.2342.19200300.100.1.50" => ["singleLevelQuality"],
191
-        "0.9.2342.19200300.100.1.51" => ["subtreeMinimumQuality"],
192
-        "0.9.2342.19200300.100.1.52" => ["subtreeMaximumQuality"],
193
-        "0.9.2342.19200300.100.1.53" => ["personalSignature"],
194
-        "0.9.2342.19200300.100.1.54" => ["dITRedirect"],
195
-        "0.9.2342.19200300.100.1.55" => ["audio"],
196
-        "0.9.2342.19200300.100.1.56" => ["documentPublisher"],
197
-        "0.9.2342.19200300.100.1.60" => ["jpegPhoto"],
198
-        "1.2.840.113549.1.9.1" => ["email", "emailAddress", "pkcs9email"],
199
-        "1.2.840.113556.1.2.102" => ["memberOf"],
200
-        "1.3.6.1.1.1.1.0" => ["uidNumber"],
201
-        "1.3.6.1.1.1.1.1" => ["gidNumber"],
202
-        "1.3.6.1.1.1.1.2" => ["gecos"],
203
-        "1.3.6.1.1.1.1.3" => ["homeDirectory"],
204
-        "1.3.6.1.1.1.1.4" => ["loginShell"],
205
-        "1.3.6.1.1.1.1.5" => ["shadowLastChange"],
206
-        "1.3.6.1.1.1.1.6" => ["shadowMin"],
207
-        "1.3.6.1.1.1.1.7" => ["shadowMax"],
208
-        "1.3.6.1.1.1.1.8" => ["shadowWarning"],
209
-        "1.3.6.1.1.1.1.9" => ["shadowInactive"],
210
-        "1.3.6.1.1.1.1.10" => ["shadowExpire"],
211
-        "1.3.6.1.1.1.1.11" => ["shadowFlag"],
212
-        "1.3.6.1.1.1.1.12" => ["memberUid"],
213
-        "1.3.6.1.1.1.1.13" => ["memberNisNetgroup"],
214
-        "1.3.6.1.1.1.1.14" => ["nisNetgroupTriple"],
215
-        "1.3.6.1.1.1.1.15" => ["ipServicePort"],
216
-        "1.3.6.1.1.1.1.16" => ["ipServiceProtocol"],
217
-        "1.3.6.1.1.1.1.17" => ["ipProtocolNumber"],
218
-        "1.3.6.1.1.1.1.18" => ["oncRpcNumber"],
219
-        "1.3.6.1.1.1.1.19" => ["ipHostNumber"],
220
-        "1.3.6.1.1.1.1.20" => ["ipNetworkNumber"],
221
-        "1.3.6.1.1.1.1.21" => ["ipNetmaskNumber"],
222
-        "1.3.6.1.1.1.1.22" => ["macAddress"],
223
-        "1.3.6.1.1.1.1.23" => ["bootParameter"],
224
-        "1.3.6.1.1.1.1.24" => ["bootFile"],
225
-        "1.3.6.1.1.1.1.26" => ["nisMapName"],
226
-        "1.3.6.1.1.1.1.27" => ["nisMapEntry"],
227
-        "1.3.6.1.1.4" => ["vendorName"],
228
-        "1.3.6.1.1.5" => ["vendorVersion"],
229
-        "1.3.6.1.1.16.4" => ["entryUUID"],
230
-        "1.3.6.1.1.20" => ["entryDN"],
231
-        "2.5.4.0" => ["objectClass"],
232
-        "2.5.4.1" => ["aliasedObjectName", "aliasedEntryName"],
233
-        "2.5.4.2" => ["knowledgeInformation"],
234
-        "2.5.4.3" => ["cn", "commonName"],
235
-        "2.5.4.4" => ["sn", "surname"],
236
-        "2.5.4.5" => ["serialNumber"],
237
-        "2.5.4.6" => ["c", "countryName"],
238
-        "2.5.4.7" => ["l", "localityName"],
239
-        "2.5.4.8" => ["st", "stateOrProvinceName"],
240
-        "2.5.4.9" => ["street", "streetAddress"],
241
-        "2.5.4.10" => ["o", "organizationName"],
242
-        "2.5.4.11" => ["ou", "organizationalUnitName"],
243
-        "2.5.4.12" => ["title"],
244
-        "2.5.4.13" => ["description"],
245
-        "2.5.4.14" => ["searchGuide"],
246
-        "2.5.4.15" => ["businessCategory"],
247
-        "2.5.4.16" => ["postalAddress"],
248
-        "2.5.4.17" => ["postalCode"],
249
-        "2.5.4.18" => ["postOfficeBox"],
250
-        "2.5.4.19" => ["physicalDeliveryOfficeName"],
251
-        "2.5.4.20" => ["telephoneNumber"],
252
-        "2.5.4.21" => ["telexNumber"],
253
-        "2.5.4.22" => ["teletexTerminalIdentifier"],
254
-        "2.5.4.23" => ["facsimileTelephoneNumber", "fax"],
255
-        "2.5.4.24" => ["x121Address"],
256
-        "2.5.4.25" => ["internationaliSDNNumber"],
257
-        "2.5.4.26" => ["registeredAddress"],
258
-        "2.5.4.27" => ["destinationIndicator"],
259
-        "2.5.4.28" => ["preferredDeliveryMethod"],
260
-        "2.5.4.29" => ["presentationAddress"],
261
-        "2.5.4.30" => ["supportedApplicationContext"],
262
-        "2.5.4.31" => ["member"],
263
-        "2.5.4.32" => ["owner"],
264
-        "2.5.4.33" => ["roleOccupant"],
265
-        "2.5.4.34" => ["seeAlso"],
266
-        "2.5.4.35" => ["userPassword"],
267
-        "2.5.4.36" => ["userCertificate"],
268
-        "2.5.4.37" => ["cACertificate"],
269
-        "2.5.4.38" => ["authorityRevocationList"],
270
-        "2.5.4.39" => ["certificateRevocationList"],
271
-        "2.5.4.40" => ["crossCertificatePair"],
272
-        "2.5.4.41" => ["name"],
273
-        "2.5.4.42" => ["givenName", "gn"],
274
-        "2.5.4.43" => ["initials"],
275
-        "2.5.4.44" => ["generationQualifier"],
276
-        "2.5.4.45" => ["x500UniqueIdentifier"],
277
-        "2.5.4.46" => ["dnQualifier"],
278
-        "2.5.4.47" => ["enhancedSearchGuide"],
279
-        "2.5.4.48" => ["protocolInformation"],
280
-        "2.5.4.49" => ["distinguishedName"],
281
-        "2.5.4.50" => ["uniqueMember"],
282
-        "2.5.4.51" => ["houseIdentifier"],
283
-        "2.5.4.52" => ["supportedAlgorithms"],
284
-        "2.5.4.53" => ["deltaRevocationList"],
285
-        "2.5.4.54" => ["dmdName"],
286
-        "2.5.4.65" => ["pseudonym"],
287
-        "2.5.18.1" => ["createTimestamp"],
288
-        "2.5.18.2" => ["modifyTimestamp"],
289
-        "2.5.18.3" => ["creatorsName"],
290
-        "2.5.18.4" => ["modifiersName"],
291
-        "2.5.18.5" => ["administrativeRole"],
292
-        "2.5.18.6" => ["subtreeSpecification"],
293
-        "2.5.18.9" => ["hasSubordinates"],
294
-        "2.5.18.10" => ["subschemaSubentry"],
295
-        "2.5.21.1" => ["dITStructureRules"],
296
-        "2.5.21.2" => ["dITContentRules"],
297
-        "2.5.21.4" => ["matchingRules"],
298
-        "2.5.21.5" => ["attributeTypes"],
299
-        "2.5.21.6" => ["objectClasses"],
300
-        "2.5.21.7" => ["nameForms"],
301
-        "2.5.21.8" => ["matchingRuleUse"],
302
-        "2.5.21.9" => ["structuralObjectClass"],
303
-        "2.16.840.1.113730.3.1.1" => ["carLicense"],
304
-        "2.16.840.1.113730.3.1.2" => ["departmentNumber"],
305
-        "2.16.840.1.113730.3.1.3" => ["employeeNumber"],
306
-        "2.16.840.1.113730.3.1.4" => ["employeeType"],
307
-        "2.16.840.1.113730.3.1.34" => ["ref"],
308
-        "2.16.840.1.113730.3.1.39" => ["preferredLanguage"],
309
-        "2.16.840.1.113730.3.1.40" => ["userSMIMECertificate"],
310
-        "2.16.840.1.113730.3.1.216" => ["userPKCS12"],
311
-        "2.16.840.1.113730.3.1.241" => ["displayName"]
312
-        /* @formatter:on */
313
-    );
138
+	/**
139
+	 * OID to attribute names mapping.
140
+	 *
141
+	 * First name is the primary name. If there's more than one name, others may
142
+	 * be used as an alias.
143
+	 *
144
+	 * Generated using ldap-attribs.py.
145
+	 *
146
+	 * @internal
147
+	 *
148
+	 * @var array
149
+	 */
150
+	const MAP_OID_TO_NAME = array(
151
+		/* @formatter:off */
152
+		"0.9.2342.19200300.100.1.1" => ["uid", "userid"],
153
+		"0.9.2342.19200300.100.1.2" => ["textEncodedORAddress"],
154
+		"0.9.2342.19200300.100.1.3" => ["mail", "rfc822Mailbox"],
155
+		"0.9.2342.19200300.100.1.4" => ["info"],
156
+		"0.9.2342.19200300.100.1.5" => ["drink", "favouriteDrink"],
157
+		"0.9.2342.19200300.100.1.6" => ["roomNumber"],
158
+		"0.9.2342.19200300.100.1.7" => ["photo"],
159
+		"0.9.2342.19200300.100.1.8" => ["userClass"],
160
+		"0.9.2342.19200300.100.1.9" => ["host"],
161
+		"0.9.2342.19200300.100.1.10" => ["manager"],
162
+		"0.9.2342.19200300.100.1.11" => ["documentIdentifier"],
163
+		"0.9.2342.19200300.100.1.12" => ["documentTitle"],
164
+		"0.9.2342.19200300.100.1.13" => ["documentVersion"],
165
+		"0.9.2342.19200300.100.1.14" => ["documentAuthor"],
166
+		"0.9.2342.19200300.100.1.15" => ["documentLocation"],
167
+		"0.9.2342.19200300.100.1.20" => ["homePhone", "homeTelephoneNumber"],
168
+		"0.9.2342.19200300.100.1.21" => ["secretary"],
169
+		"0.9.2342.19200300.100.1.22" => ["otherMailbox"],
170
+		"0.9.2342.19200300.100.1.25" => ["dc", "domainComponent"],
171
+		"0.9.2342.19200300.100.1.26" => ["aRecord"],
172
+		"0.9.2342.19200300.100.1.27" => ["mDRecord"],
173
+		"0.9.2342.19200300.100.1.28" => ["mXRecord"],
174
+		"0.9.2342.19200300.100.1.29" => ["nSRecord"],
175
+		"0.9.2342.19200300.100.1.30" => ["sOARecord"],
176
+		"0.9.2342.19200300.100.1.31" => ["cNAMERecord"],
177
+		"0.9.2342.19200300.100.1.37" => ["associatedDomain"],
178
+		"0.9.2342.19200300.100.1.38" => ["associatedName"],
179
+		"0.9.2342.19200300.100.1.39" => ["homePostalAddress"],
180
+		"0.9.2342.19200300.100.1.40" => ["personalTitle"],
181
+		"0.9.2342.19200300.100.1.41" => ["mobile", "mobileTelephoneNumber"],
182
+		"0.9.2342.19200300.100.1.42" => ["pager", "pagerTelephoneNumber"],
183
+		"0.9.2342.19200300.100.1.43" => ["co", "friendlyCountryName"],
184
+		"0.9.2342.19200300.100.1.44" => ["uniqueIdentifier"],
185
+		"0.9.2342.19200300.100.1.45" => ["organizationalStatus"],
186
+		"0.9.2342.19200300.100.1.46" => ["janetMailbox"],
187
+		"0.9.2342.19200300.100.1.47" => ["mailPreferenceOption"],
188
+		"0.9.2342.19200300.100.1.48" => ["buildingName"],
189
+		"0.9.2342.19200300.100.1.49" => ["dSAQuality"],
190
+		"0.9.2342.19200300.100.1.50" => ["singleLevelQuality"],
191
+		"0.9.2342.19200300.100.1.51" => ["subtreeMinimumQuality"],
192
+		"0.9.2342.19200300.100.1.52" => ["subtreeMaximumQuality"],
193
+		"0.9.2342.19200300.100.1.53" => ["personalSignature"],
194
+		"0.9.2342.19200300.100.1.54" => ["dITRedirect"],
195
+		"0.9.2342.19200300.100.1.55" => ["audio"],
196
+		"0.9.2342.19200300.100.1.56" => ["documentPublisher"],
197
+		"0.9.2342.19200300.100.1.60" => ["jpegPhoto"],
198
+		"1.2.840.113549.1.9.1" => ["email", "emailAddress", "pkcs9email"],
199
+		"1.2.840.113556.1.2.102" => ["memberOf"],
200
+		"1.3.6.1.1.1.1.0" => ["uidNumber"],
201
+		"1.3.6.1.1.1.1.1" => ["gidNumber"],
202
+		"1.3.6.1.1.1.1.2" => ["gecos"],
203
+		"1.3.6.1.1.1.1.3" => ["homeDirectory"],
204
+		"1.3.6.1.1.1.1.4" => ["loginShell"],
205
+		"1.3.6.1.1.1.1.5" => ["shadowLastChange"],
206
+		"1.3.6.1.1.1.1.6" => ["shadowMin"],
207
+		"1.3.6.1.1.1.1.7" => ["shadowMax"],
208
+		"1.3.6.1.1.1.1.8" => ["shadowWarning"],
209
+		"1.3.6.1.1.1.1.9" => ["shadowInactive"],
210
+		"1.3.6.1.1.1.1.10" => ["shadowExpire"],
211
+		"1.3.6.1.1.1.1.11" => ["shadowFlag"],
212
+		"1.3.6.1.1.1.1.12" => ["memberUid"],
213
+		"1.3.6.1.1.1.1.13" => ["memberNisNetgroup"],
214
+		"1.3.6.1.1.1.1.14" => ["nisNetgroupTriple"],
215
+		"1.3.6.1.1.1.1.15" => ["ipServicePort"],
216
+		"1.3.6.1.1.1.1.16" => ["ipServiceProtocol"],
217
+		"1.3.6.1.1.1.1.17" => ["ipProtocolNumber"],
218
+		"1.3.6.1.1.1.1.18" => ["oncRpcNumber"],
219
+		"1.3.6.1.1.1.1.19" => ["ipHostNumber"],
220
+		"1.3.6.1.1.1.1.20" => ["ipNetworkNumber"],
221
+		"1.3.6.1.1.1.1.21" => ["ipNetmaskNumber"],
222
+		"1.3.6.1.1.1.1.22" => ["macAddress"],
223
+		"1.3.6.1.1.1.1.23" => ["bootParameter"],
224
+		"1.3.6.1.1.1.1.24" => ["bootFile"],
225
+		"1.3.6.1.1.1.1.26" => ["nisMapName"],
226
+		"1.3.6.1.1.1.1.27" => ["nisMapEntry"],
227
+		"1.3.6.1.1.4" => ["vendorName"],
228
+		"1.3.6.1.1.5" => ["vendorVersion"],
229
+		"1.3.6.1.1.16.4" => ["entryUUID"],
230
+		"1.3.6.1.1.20" => ["entryDN"],
231
+		"2.5.4.0" => ["objectClass"],
232
+		"2.5.4.1" => ["aliasedObjectName", "aliasedEntryName"],
233
+		"2.5.4.2" => ["knowledgeInformation"],
234
+		"2.5.4.3" => ["cn", "commonName"],
235
+		"2.5.4.4" => ["sn", "surname"],
236
+		"2.5.4.5" => ["serialNumber"],
237
+		"2.5.4.6" => ["c", "countryName"],
238
+		"2.5.4.7" => ["l", "localityName"],
239
+		"2.5.4.8" => ["st", "stateOrProvinceName"],
240
+		"2.5.4.9" => ["street", "streetAddress"],
241
+		"2.5.4.10" => ["o", "organizationName"],
242
+		"2.5.4.11" => ["ou", "organizationalUnitName"],
243
+		"2.5.4.12" => ["title"],
244
+		"2.5.4.13" => ["description"],
245
+		"2.5.4.14" => ["searchGuide"],
246
+		"2.5.4.15" => ["businessCategory"],
247
+		"2.5.4.16" => ["postalAddress"],
248
+		"2.5.4.17" => ["postalCode"],
249
+		"2.5.4.18" => ["postOfficeBox"],
250
+		"2.5.4.19" => ["physicalDeliveryOfficeName"],
251
+		"2.5.4.20" => ["telephoneNumber"],
252
+		"2.5.4.21" => ["telexNumber"],
253
+		"2.5.4.22" => ["teletexTerminalIdentifier"],
254
+		"2.5.4.23" => ["facsimileTelephoneNumber", "fax"],
255
+		"2.5.4.24" => ["x121Address"],
256
+		"2.5.4.25" => ["internationaliSDNNumber"],
257
+		"2.5.4.26" => ["registeredAddress"],
258
+		"2.5.4.27" => ["destinationIndicator"],
259
+		"2.5.4.28" => ["preferredDeliveryMethod"],
260
+		"2.5.4.29" => ["presentationAddress"],
261
+		"2.5.4.30" => ["supportedApplicationContext"],
262
+		"2.5.4.31" => ["member"],
263
+		"2.5.4.32" => ["owner"],
264
+		"2.5.4.33" => ["roleOccupant"],
265
+		"2.5.4.34" => ["seeAlso"],
266
+		"2.5.4.35" => ["userPassword"],
267
+		"2.5.4.36" => ["userCertificate"],
268
+		"2.5.4.37" => ["cACertificate"],
269
+		"2.5.4.38" => ["authorityRevocationList"],
270
+		"2.5.4.39" => ["certificateRevocationList"],
271
+		"2.5.4.40" => ["crossCertificatePair"],
272
+		"2.5.4.41" => ["name"],
273
+		"2.5.4.42" => ["givenName", "gn"],
274
+		"2.5.4.43" => ["initials"],
275
+		"2.5.4.44" => ["generationQualifier"],
276
+		"2.5.4.45" => ["x500UniqueIdentifier"],
277
+		"2.5.4.46" => ["dnQualifier"],
278
+		"2.5.4.47" => ["enhancedSearchGuide"],
279
+		"2.5.4.48" => ["protocolInformation"],
280
+		"2.5.4.49" => ["distinguishedName"],
281
+		"2.5.4.50" => ["uniqueMember"],
282
+		"2.5.4.51" => ["houseIdentifier"],
283
+		"2.5.4.52" => ["supportedAlgorithms"],
284
+		"2.5.4.53" => ["deltaRevocationList"],
285
+		"2.5.4.54" => ["dmdName"],
286
+		"2.5.4.65" => ["pseudonym"],
287
+		"2.5.18.1" => ["createTimestamp"],
288
+		"2.5.18.2" => ["modifyTimestamp"],
289
+		"2.5.18.3" => ["creatorsName"],
290
+		"2.5.18.4" => ["modifiersName"],
291
+		"2.5.18.5" => ["administrativeRole"],
292
+		"2.5.18.6" => ["subtreeSpecification"],
293
+		"2.5.18.9" => ["hasSubordinates"],
294
+		"2.5.18.10" => ["subschemaSubentry"],
295
+		"2.5.21.1" => ["dITStructureRules"],
296
+		"2.5.21.2" => ["dITContentRules"],
297
+		"2.5.21.4" => ["matchingRules"],
298
+		"2.5.21.5" => ["attributeTypes"],
299
+		"2.5.21.6" => ["objectClasses"],
300
+		"2.5.21.7" => ["nameForms"],
301
+		"2.5.21.8" => ["matchingRuleUse"],
302
+		"2.5.21.9" => ["structuralObjectClass"],
303
+		"2.16.840.1.113730.3.1.1" => ["carLicense"],
304
+		"2.16.840.1.113730.3.1.2" => ["departmentNumber"],
305
+		"2.16.840.1.113730.3.1.3" => ["employeeNumber"],
306
+		"2.16.840.1.113730.3.1.4" => ["employeeType"],
307
+		"2.16.840.1.113730.3.1.34" => ["ref"],
308
+		"2.16.840.1.113730.3.1.39" => ["preferredLanguage"],
309
+		"2.16.840.1.113730.3.1.40" => ["userSMIMECertificate"],
310
+		"2.16.840.1.113730.3.1.216" => ["userPKCS12"],
311
+		"2.16.840.1.113730.3.1.241" => ["displayName"]
312
+		/* @formatter:on */
313
+	);
314 314
     
315
-    /**
316
-     * OID of the attribute.
317
-     *
318
-     * @var string $_oid
319
-     */
320
-    protected $_oid;
315
+	/**
316
+	 * OID of the attribute.
317
+	 *
318
+	 * @var string $_oid
319
+	 */
320
+	protected $_oid;
321 321
     
322
-    /**
323
-     * Constructor.
324
-     *
325
-     * @param string $oid OID in dotted format.
326
-     */
327
-    public function __construct($oid)
328
-    {
329
-        $this->_oid = $oid;
330
-    }
322
+	/**
323
+	 * Constructor.
324
+	 *
325
+	 * @param string $oid OID in dotted format.
326
+	 */
327
+	public function __construct($oid)
328
+	{
329
+		$this->_oid = $oid;
330
+	}
331 331
     
332
-    /**
333
-     * Initialize from ASN.1.
334
-     *
335
-     * @param ObjectIdentifier $oi
336
-     * @return self
337
-     */
338
-    public static function fromASN1(ObjectIdentifier $oi)
339
-    {
340
-        return new self($oi->oid());
341
-    }
332
+	/**
333
+	 * Initialize from ASN.1.
334
+	 *
335
+	 * @param ObjectIdentifier $oi
336
+	 * @return self
337
+	 */
338
+	public static function fromASN1(ObjectIdentifier $oi)
339
+	{
340
+		return new self($oi->oid());
341
+	}
342 342
     
343
-    /**
344
-     * Initialize from attribute name.
345
-     *
346
-     * @param string $name
347
-     * @return self
348
-     */
349
-    public static function fromName($name)
350
-    {
351
-        $oid = self::attrNameToOID($name);
352
-        return new self($oid);
353
-    }
343
+	/**
344
+	 * Initialize from attribute name.
345
+	 *
346
+	 * @param string $name
347
+	 * @return self
348
+	 */
349
+	public static function fromName($name)
350
+	{
351
+		$oid = self::attrNameToOID($name);
352
+		return new self($oid);
353
+	}
354 354
     
355
-    /**
356
-     * Get OID of the attribute.
357
-     *
358
-     * @return string OID in dotted format
359
-     */
360
-    public function oid()
361
-    {
362
-        return $this->_oid;
363
-    }
355
+	/**
356
+	 * Get OID of the attribute.
357
+	 *
358
+	 * @return string OID in dotted format
359
+	 */
360
+	public function oid()
361
+	{
362
+		return $this->_oid;
363
+	}
364 364
     
365
-    /**
366
-     * Get name of the attribute.
367
-     *
368
-     * @return string
369
-     */
370
-    public function typeName()
371
-    {
372
-        if (array_key_exists($this->_oid, self::MAP_OID_TO_NAME)) {
373
-            return self::MAP_OID_TO_NAME[$this->_oid][0];
374
-        }
375
-        return $this->_oid;
376
-    }
365
+	/**
366
+	 * Get name of the attribute.
367
+	 *
368
+	 * @return string
369
+	 */
370
+	public function typeName()
371
+	{
372
+		if (array_key_exists($this->_oid, self::MAP_OID_TO_NAME)) {
373
+			return self::MAP_OID_TO_NAME[$this->_oid][0];
374
+		}
375
+		return $this->_oid;
376
+	}
377 377
     
378
-    /**
379
-     * Generate ASN.1 element.
380
-     *
381
-     * @return ObjectIdentifier
382
-     */
383
-    public function toASN1()
384
-    {
385
-        return new ObjectIdentifier($this->_oid);
386
-    }
378
+	/**
379
+	 * Generate ASN.1 element.
380
+	 *
381
+	 * @return ObjectIdentifier
382
+	 */
383
+	public function toASN1()
384
+	{
385
+		return new ObjectIdentifier($this->_oid);
386
+	}
387 387
     
388
-    /**
389
-     * Get name to OID lookup map.
390
-     *
391
-     * @return array
392
-     */
393
-    private static function _oidReverseMap()
394
-    {
395
-        static $map;
396
-        if (!isset($map)) {
397
-            $map = array();
398
-            // for eatch attribute type
399
-            foreach (self::MAP_OID_TO_NAME as $oid => $names) {
400
-                // for primary name and aliases
401
-                foreach ($names as $name) {
402
-                    $map[strtolower($name)] = $oid;
403
-                }
404
-            }
405
-        }
406
-        return $map;
407
-    }
388
+	/**
389
+	 * Get name to OID lookup map.
390
+	 *
391
+	 * @return array
392
+	 */
393
+	private static function _oidReverseMap()
394
+	{
395
+		static $map;
396
+		if (!isset($map)) {
397
+			$map = array();
398
+			// for eatch attribute type
399
+			foreach (self::MAP_OID_TO_NAME as $oid => $names) {
400
+				// for primary name and aliases
401
+				foreach ($names as $name) {
402
+					$map[strtolower($name)] = $oid;
403
+				}
404
+			}
405
+		}
406
+		return $map;
407
+	}
408 408
     
409
-    /**
410
-     * Convert attribute name to OID.
411
-     *
412
-     * @param string $name Primary attribute name or an alias
413
-     * @throws \OutOfBoundsException
414
-     * @return string OID in dotted format
415
-     */
416
-    public static function attrNameToOID($name)
417
-    {
418
-        // if already in OID form
419
-        if (preg_match('/^[0-9]+(?:\.[0-9]+)*$/', $name)) {
420
-            return $name;
421
-        }
422
-        $map = self::_oidReverseMap();
423
-        $k = strtolower($name);
424
-        if (!isset($map[$k])) {
425
-            throw new \OutOfBoundsException("No OID for $name.");
426
-        }
427
-        return $map[$k];
428
-    }
409
+	/**
410
+	 * Convert attribute name to OID.
411
+	 *
412
+	 * @param string $name Primary attribute name or an alias
413
+	 * @throws \OutOfBoundsException
414
+	 * @return string OID in dotted format
415
+	 */
416
+	public static function attrNameToOID($name)
417
+	{
418
+		// if already in OID form
419
+		if (preg_match('/^[0-9]+(?:\.[0-9]+)*$/', $name)) {
420
+			return $name;
421
+		}
422
+		$map = self::_oidReverseMap();
423
+		$k = strtolower($name);
424
+		if (!isset($map[$k])) {
425
+			throw new \OutOfBoundsException("No OID for $name.");
426
+		}
427
+		return $map[$k];
428
+	}
429 429
     
430
-    /**
431
-     * Get ASN.1 string for given attribute type.
432
-     *
433
-     * @param string $oid Attribute OID
434
-     * @param string $str String
435
-     * @throws \LogicException
436
-     * @return \ASN1\Type\StringType
437
-     */
438
-    public static function asn1StringForType($oid, $str)
439
-    {
440
-        if (!array_key_exists($oid, self::MAP_ATTR_TO_STR_TYPE)) {
441
-            return new UTF8String($str);
442
-        }
443
-        switch (self::MAP_ATTR_TO_STR_TYPE[$oid]) {
444
-            case Element::TYPE_PRINTABLE_STRING:
445
-                return new PrintableString($str);
446
-            // @codeCoverageIgnoreStart
447
-            default:
448
-                // only reachable during development
449
-                throw new \LogicException();
450
-        }
451
-        // @codeCoverageIgnoreEnd
452
-    }
430
+	/**
431
+	 * Get ASN.1 string for given attribute type.
432
+	 *
433
+	 * @param string $oid Attribute OID
434
+	 * @param string $str String
435
+	 * @throws \LogicException
436
+	 * @return \ASN1\Type\StringType
437
+	 */
438
+	public static function asn1StringForType($oid, $str)
439
+	{
440
+		if (!array_key_exists($oid, self::MAP_ATTR_TO_STR_TYPE)) {
441
+			return new UTF8String($str);
442
+		}
443
+		switch (self::MAP_ATTR_TO_STR_TYPE[$oid]) {
444
+			case Element::TYPE_PRINTABLE_STRING:
445
+				return new PrintableString($str);
446
+			// @codeCoverageIgnoreStart
447
+			default:
448
+				// only reachable during development
449
+				throw new \LogicException();
450
+		}
451
+		// @codeCoverageIgnoreEnd
452
+	}
453 453
 }
Please login to merge, or discard this patch.
Switch Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -441,12 +441,12 @@
 block discarded – undo
441 441
             return new UTF8String($str);
442 442
         }
443 443
         switch (self::MAP_ATTR_TO_STR_TYPE[$oid]) {
444
-            case Element::TYPE_PRINTABLE_STRING:
445
-                return new PrintableString($str);
446
-            // @codeCoverageIgnoreStart
447
-            default:
448
-                // only reachable during development
449
-                throw new \LogicException();
444
+        case Element::TYPE_PRINTABLE_STRING:
445
+            return new PrintableString($str);
446
+        // @codeCoverageIgnoreStart
447
+        default:
448
+            // only reachable during development
449
+            throw new \LogicException();
450 450
         }
451 451
         // @codeCoverageIgnoreEnd
452 452
     }
Please login to merge, or discard this patch.
lib/X501/ASN1/AttributeValue/NameValue.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -13,15 +13,15 @@
 block discarded – undo
13 13
  */
14 14
 class NameValue extends DirectoryString
15 15
 {
16
-    /**
17
-     * Constructor.
18
-     *
19
-     * @param string $value String value
20
-     * @param int $string_tag Syntax choice
21
-     */
22
-    public function __construct($value, $string_tag = DirectoryString::UTF8)
23
-    {
24
-        $this->_oid = AttributeType::OID_NAME;
25
-        parent::__construct($value, $string_tag);
26
-    }
16
+	/**
17
+	 * Constructor.
18
+	 *
19
+	 * @param string $value String value
20
+	 * @param int $string_tag Syntax choice
21
+	 */
22
+	public function __construct($value, $string_tag = DirectoryString::UTF8)
23
+	{
24
+		$this->_oid = AttributeType::OID_NAME;
25
+		parent::__construct($value, $string_tag);
26
+	}
27 27
 }
Please login to merge, or discard this patch.
lib/X501/ASN1/AttributeValue/TitleValue.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -13,15 +13,15 @@
 block discarded – undo
13 13
  */
14 14
 class TitleValue extends DirectoryString
15 15
 {
16
-    /**
17
-     * Constructor.
18
-     *
19
-     * @param string $value String value
20
-     * @param int $string_tag Syntax choice
21
-     */
22
-    public function __construct($value, $string_tag = DirectoryString::UTF8)
23
-    {
24
-        $this->_oid = AttributeType::OID_TITLE;
25
-        parent::__construct($value, $string_tag);
26
-    }
16
+	/**
17
+	 * Constructor.
18
+	 *
19
+	 * @param string $value String value
20
+	 * @param int $string_tag Syntax choice
21
+	 */
22
+	public function __construct($value, $string_tag = DirectoryString::UTF8)
23
+	{
24
+		$this->_oid = AttributeType::OID_TITLE;
25
+		parent::__construct($value, $string_tag);
26
+	}
27 27
 }
Please login to merge, or discard this patch.
lib/X501/ASN1/AttributeValue/GivenNameValue.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -13,15 +13,15 @@
 block discarded – undo
13 13
  */
14 14
 class GivenNameValue extends DirectoryString
15 15
 {
16
-    /**
17
-     * Constructor.
18
-     *
19
-     * @param string $value String value
20
-     * @param int $string_tag Syntax choice
21
-     */
22
-    public function __construct($value, $string_tag = DirectoryString::UTF8)
23
-    {
24
-        $this->_oid = AttributeType::OID_GIVEN_NAME;
25
-        parent::__construct($value, $string_tag);
26
-    }
16
+	/**
17
+	 * Constructor.
18
+	 *
19
+	 * @param string $value String value
20
+	 * @param int $string_tag Syntax choice
21
+	 */
22
+	public function __construct($value, $string_tag = DirectoryString::UTF8)
23
+	{
24
+		$this->_oid = AttributeType::OID_GIVEN_NAME;
25
+		parent::__construct($value, $string_tag);
26
+	}
27 27
 }
Please login to merge, or discard this patch.
lib/X501/ASN1/AttributeValue/OrganizationalUnitNameValue.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -13,15 +13,15 @@
 block discarded – undo
13 13
  */
14 14
 class OrganizationalUnitNameValue extends DirectoryString
15 15
 {
16
-    /**
17
-     * Constructor.
18
-     *
19
-     * @param string $value String value
20
-     * @param int $string_tag Syntax choice
21
-     */
22
-    public function __construct($value, $string_tag = DirectoryString::UTF8)
23
-    {
24
-        $this->_oid = AttributeType::OID_ORGANIZATIONAL_UNIT_NAME;
25
-        parent::__construct($value, $string_tag);
26
-    }
16
+	/**
17
+	 * Constructor.
18
+	 *
19
+	 * @param string $value String value
20
+	 * @param int $string_tag Syntax choice
21
+	 */
22
+	public function __construct($value, $string_tag = DirectoryString::UTF8)
23
+	{
24
+		$this->_oid = AttributeType::OID_ORGANIZATIONAL_UNIT_NAME;
25
+		parent::__construct($value, $string_tag);
26
+	}
27 27
 }
Please login to merge, or discard this patch.