mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-17 18:55:13 +00:00
Tests/X509: add unit test for issue involving multiple domain names
This commit is contained in:
parent
ecb92ad25c
commit
91a0866fdc
@ -454,4 +454,30 @@ Mj93S
|
||||
|
||||
runkit_constant_remove('FILE_X509_IGNORE_TYPE');
|
||||
}
|
||||
|
||||
// fixed by #1104
|
||||
public function testMultipleDomainNames()
|
||||
{
|
||||
$keyGenerator = new RSA();
|
||||
$keys = $keyGenerator->createKey(512);
|
||||
|
||||
$privateKey = new RSA();
|
||||
$privateKey->loadKey($keys['privatekey']);
|
||||
|
||||
$publicKey = new RSA();
|
||||
$publicKey->loadKey($keys['publickey']);
|
||||
$publicKey->setPublicKey();
|
||||
|
||||
$subject = new X509();
|
||||
$subject->setDomain('example.com', 'example.net');
|
||||
|
||||
$subject->setPublicKey($publicKey);
|
||||
|
||||
$issuer = new X509();
|
||||
$issuer->setPrivateKey($privateKey);
|
||||
$issuer->setDN($subject->getDN());
|
||||
|
||||
$x509 = new X509();
|
||||
$x509->sign($issuer, $subject);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user