Rev 115 | Rev 148 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 115 | Rev 139 | ||
---|---|---|---|
Line 199... | Line 199... | ||
199 | 199 | ||
200 | public static function getDisabledObjectTypes() { |
200 | public static function getDisabledObjectTypes() { |
201 | return self::$disabledObjectTypes; |
201 | return self::$disabledObjectTypes; |
202 | } |
202 | } |
203 | 203 | ||
- | 204 | private static $system_id_cache = null; |
|
204 | public static function system_id($oid=false) { |
205 | public static function system_id($oid=false) { |
- | 206 | if (!is_null(self::$system_id_cache)) { |
|
- | 207 | $out = self::$system_id_cache; |
|
- | 208 | } else { |
|
- | 209 | $out = false; |
|
- | 210 | ||
205 | if (!self::pkiStatus(true)) return false; |
211 | if (self::pkiStatus(true)) { |
206 | $pubKey = OIDplus::config()->getValue('oidplus_public_key'); |
212 | $pubKey = OIDplus::config()->getValue('oidplus_public_key'); |
207 | if (preg_match('@BEGIN PUBLIC KEY\-+(.+)\-+END PUBLIC KEY@ismU', $pubKey, $m)) { |
213 | if (preg_match('@BEGIN PUBLIC KEY\-+(.+)\-+END PUBLIC KEY@ismU', $pubKey, $m)) { |
208 | return ($oid ? '1.3.6.1.4.1.37476.30.9.' : '').smallhash(base64_decode($m[1])); |
214 | $out = smallhash(base64_decode($m[1])); |
- | 215 | } |
|
- | 216 | } |
|
- | 217 | self::$system_id_cache = $out; |
|
209 | } |
218 | } |
210 | return false; |
219 | return ($oid ? '1.3.6.1.4.1.37476.30.9.' : '').$out; |
211 | } |
220 | } |
212 | 221 | ||
213 | public static function pkiStatus($try_generate=true) { |
222 | public static function pkiStatus($try_generate=true) { |
214 | if (!function_exists('openssl_pkey_new')) return false; |
223 | if (!function_exists('openssl_pkey_new')) return false; |
215 | 224 |