コード例 #1
0
 public function isSupported(FOFUtilsPhpfunc $phpfunc = null)
 {
     if (!is_object($phpfunc) || !$phpfunc instanceof $phpfunc) {
         $phpfunc = new FOFUtilsPhpfunc();
     }
     if (!$phpfunc->function_exists('openssl_get_cipher_methods')) {
         return false;
     }
     if (!$phpfunc->function_exists('openssl_random_pseudo_bytes')) {
         return false;
     }
     if (!$phpfunc->function_exists('openssl_cipher_iv_length')) {
         return false;
     }
     if (!$phpfunc->function_exists('openssl_encrypt')) {
         return false;
     }
     if (!$phpfunc->function_exists('openssl_decrypt')) {
         return false;
     }
     if (!$phpfunc->function_exists('hash')) {
         return false;
     }
     if (!$phpfunc->function_exists('hash_algos')) {
         return false;
     }
     $algorightms = $phpfunc->openssl_get_cipher_methods();
     if (!in_array('aes-128-cbc', $algorightms)) {
         return false;
     }
     $algorightms = $phpfunc->hash_algos();
     if (!in_array('sha256', $algorightms)) {
         return false;
     }
     return true;
 }