示例#1
0
    public function testEncryptionWithPublicKey()
    {
        $publicKey  = new Rsa\PublicKey($this->_testCertificateString);
        $privateKey = new Rsa\PrivateKey($this->_testPemString);

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

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