public function __construct(Key $source, $key, $bits, $type, array $details = [])
{
Assert::stringNotEmpty($key, __CLASS__ . '::$key expected a non empty string. Got: %s');
Assert::integer($bits, __CLASS__ . '::$bits expected an integer. Got: %s');
Assert::oneOf($type, [OPENSSL_KEYTYPE_RSA, OPENSSL_KEYTYPE_DSA, OPENSSL_KEYTYPE_DH, OPENSSL_KEYTYPE_EC], __CLASS__ . '::$type expected one of: %2$s. Got: %s');
$this->source = $source;
$this->key = $key;
$this->bits = $bits;
$this->type = $type;
$this->details = $details;
}