Submit
Path:
~
/
/
usr
/
local
/
psa
/
admin
/
plib
/
modules
/
sslit
/
vendor
/
acmephp
/
ssl
/
Generator
/
DhKey
/
File Content:
DhKeyGenerator.php
<?php /* * This file is part of the Acme PHP project. * * (c) Titouan Galopin <galopintitouan@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PleskSslIt\AcmePhp\Ssl\Generator\DhKey; use PleskSslIt\AcmePhp\Ssl\Generator\KeyOption; use PleskSslIt\AcmePhp\Ssl\Generator\OpensslPrivateKeyGeneratorTrait; use PleskSslIt\AcmePhp\Ssl\Generator\PrivateKeyGeneratorInterface; use PleskSslIt\Webmozart\Assert\Assert; /** * Generate random DH private key using OpenSSL. * * @author Jérémy Derussé <jeremy@derusse.com> */ class DhKeyGenerator implements PrivateKeyGeneratorInterface { use OpensslPrivateKeyGeneratorTrait; /** * @param DhKeyOption|KeyOption $keyOption */ public function generatePrivateKey(KeyOption $keyOption) { Assert::isInstanceOf($keyOption, DhKeyOption::class); return $this->generatePrivateKeyFromOpensslOptions(['private_key_type' => \OPENSSL_KEYTYPE_DH, 'dh' => ['p' => $keyOption->getPrime(), 'g' => $keyOption->getGenerator()]]); } public function supportsKeyOption(KeyOption $keyOption) { return $keyOption instanceof DhKeyOption; } }
Edit
Rename
Chmod
Delete
FILE
FOLDER
INFO
Name
Size
Permission
Action
DhKeyGenerator.php
1236 bytes
0644
DhKeyOption.php
1141 bytes
0644
N4ST4R_ID | Naxtarrr