1 | <?php |
||
8 | final class Binding implements Serializable |
||
9 | { |
||
10 | /** |
||
11 | * URNs for the various bindings |
||
12 | */ |
||
13 | const HTTP_POST = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST'; |
||
14 | const HTTP_REDIRECT = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'; |
||
15 | const HTTP_ARTIFACT = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact'; |
||
16 | const SOAP = 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP'; |
||
17 | const HOK_SSO = 'urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser'; |
||
18 | |||
19 | private static $validBindings = array( |
||
20 | self::HTTP_POST, |
||
21 | self::HTTP_REDIRECT, |
||
22 | self::HTTP_ARTIFACT, |
||
23 | self::SOAP, |
||
24 | self::HOK_SSO |
||
25 | ); |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private $binding; |
||
31 | |||
32 | public function __construct($binding) |
||
41 | |||
42 | /** |
||
43 | * @return Binding |
||
44 | */ |
||
45 | public static function httpPost() |
||
49 | |||
50 | /** |
||
51 | * @return Binding |
||
52 | */ |
||
53 | public static function httpRedirect() |
||
57 | |||
58 | /** |
||
59 | * @return Binding |
||
60 | */ |
||
61 | public static function httpArtifact() |
||
65 | |||
66 | /** |
||
67 | * @return Binding |
||
68 | */ |
||
69 | public static function soap() |
||
73 | |||
74 | /** |
||
75 | * @return Binding |
||
76 | */ |
||
77 | public static function holderOfKey() |
||
81 | |||
82 | /** |
||
83 | * @param $binding |
||
84 | * @return bool |
||
85 | */ |
||
86 | public static function isValidBinding($binding) |
||
90 | |||
91 | /** |
||
92 | * @param string $binding |
||
93 | * @return bool |
||
94 | */ |
||
95 | public function isOfType($binding) |
||
104 | |||
105 | /** |
||
106 | * @return string |
||
107 | */ |
||
108 | public function getBinding() |
||
112 | |||
113 | /** |
||
114 | * @param Binding $other |
||
115 | * @return bool |
||
116 | */ |
||
117 | public function equals(Binding $other) |
||
121 | |||
122 | public static function deserialize($data) |
||
128 | |||
129 | public function serialize() |
||
133 | |||
134 | public function __toString() |
||
138 | } |
||
139 |