コード例 #1
0
ファイル: crypt.php プロジェクト: droiter/openwrt-on-android
 public function testDecryptPrivateKey()
 {
     // test successful decrypt
     $crypted = Encryption\Crypt::symmetricEncryptFileContent($this->genPrivateKey, 'hat');
     $header = Encryption\Crypt::generateHeader();
     $decrypted = Encryption\Crypt::decryptPrivateKey($header . $crypted, 'hat');
     $this->assertEquals($this->genPrivateKey, $decrypted);
     //test private key decrypt with wrong password
     $wrongPasswd = Encryption\Crypt::decryptPrivateKey($crypted, 'hat2');
     $this->assertEquals(false, $wrongPasswd);
 }