예제 #1
0
 /**
  * Analizar un valor encriptado y devolverlo desencriptado
  *
  * @param $param
  * @return string
  */
 public static function analyzeEncrypted($param)
 {
     $encryptedData = self::analyze($param, '', false, false, false);
     if ($encryptedData === '') {
         return '';
     }
     try {
         // Desencriptar con la clave RSA
         $CryptPKI = new CryptPKI();
         $clearData = $CryptPKI->decryptRSA(base64_decode($encryptedData));
     } catch (\Exception $e) {
         return $encryptedData;
     }
     return $clearData;
 }
예제 #2
0
 /**
  * Establecer la clave pública RSA en la sessión
  */
 public static function loadPublicKey()
 {
     $CryptPKI = new CryptPKI();
     Session::setPublicKey($CryptPKI->getPublicKey());
 }