mirror of
https://github.com/danog/phpseclib.git
synced 2024-12-04 02:28:06 +01:00
Tests/RSA: add unit test for exceptions
This commit is contained in:
parent
2b28c3814b
commit
db85a95af2
@ -1015,4 +1015,22 @@ YYFw8pfGesIFoEuVth4HKyF8k1y4mRUnYHP1XNMNMJl1JcEArC2asV8sHf6zSPVffozZ
|
||||
$key = PublicKeyLoader::load($key);
|
||||
$this->assertInstanceOf(PublicKey::class, $key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \phpseclib3\Exception\UnsupportedFormatException
|
||||
*/
|
||||
public function testSavePasswordXML()
|
||||
{
|
||||
$key = '-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIBOgIBAAJBAKj34GkxFhD90vcNLYLInFEX6Ppy1tPf9Cnzj4p4WGeKLs1Pt8Qu
|
||||
KUpRKfFLfRYC9AIKjbJTWit+CqvjWYzvQwECAwEAAQJAIJLixBy2qpFoS4DSmoEm
|
||||
o3qGy0t6z09AIJtH+5OeRV1be+N4cDYJKffGzDa88vQENZiRm0GRq6a+HPGQMd2k
|
||||
TQIhAKMSvzIBnni7ot/OSie2TmJLY4SwTQAevXysE2RbFDYdAiEBCUEaRQnMnbp7
|
||||
9mxDXDf6AU0cN/RPBjb9qSHDcWZHGzUCIG2Es59z8ugGrDY+pxLQnwfotadxd+Uy
|
||||
v/Ow5T0q5gIJAiEAyS4RaI9YG8EWx/2w0T67ZUVAw8eOMB6BIUg0Xcu+3okCIBOs
|
||||
/5OiPgoTdSy7bcF9IGpSE8ZgGKzgYQVZeN97YE00
|
||||
-----END RSA PRIVATE KEY-----';
|
||||
$key = PublicKeyLoader::load($key);
|
||||
$key->withPassword('demo')->toString('XML');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user