function setXMLGENERATEKEY($xmlGenerateKey) { $this->xmlGenerateKeyEnc = $xmlGenerateKey; $rsa = new RSAEncryption(); $rsa->setPrivateKey($this->CipherPrivateKey); $xmlGenerateKey = urldecode($xmlGenerateKey); if (strrpos($xmlGenerateKey, ">") != -1) { $xmlGenerateKey = substr($xmlGenerateKey, 0, strlen($xmlGenerateKey) - 1); } $this->xmlGenerateKey = $rsa->decrypt($xmlGenerateKey); if ($this->xmlGenerateKey == "") { return "Se ha presentado un problema al desencriptar. Posiblemente la llave utilizada no es correcta"; } }
function CreateXMLGENERATEKEY() { $this->xmlGenerateKeyEnc = ""; $d3 = new TripleDESEncryption(); $this->xmlGenerateKey = $d3->generateKey(); //encripta la llave $rsa = new RSAEncryption(); $rsa->setPublicKey($this->CipherPublicKey); $this->xmlGenerateKeyEnc = $rsa->encrypt($this->xmlGenerateKey); $this->xmlGenerateKeyEnc = urlencode($this->xmlGenerateKeyEnc); return $this->xmlGenerateKeyEnc; }