Ejemplo n.º 1
0
    public function testEncryptionWithPrivateKey()
    {
        $publicKey  = new Rsa\PublicKey($this->_testCertificateString);
        $privateKey = new Rsa\PrivateKey($this->_testPemString);

        $encrypted = $privateKey->encrypt('1234567890');

        $this->assertEquals('1234567890', $publicKey->decrypt($encrypted));
    }