CryptKey
$privateKey,
CryptKey
$publicKey,
?Encoder
$encoder = null,
?Decoder
$decoder = null
): Configuration
{ /** @var non-empty-string $privateKeyText */
$privateKeyText =
$privateKey->
getKeyContents();
/** @var non-empty-string $publicKeyText */
$publicKeyText =
$publicKey->
getKeyContents();
if ($privateKey->
getKeyPath() === ''
) { $privateKey = InMemory::
plainText($privateKeyText,
$privateKey->
getPassPhrase() ?? ''
);
$publicKey = InMemory::
plainText($publicKeyText,
$publicKey->
getPassPhrase() ?? ''
);
} else { $privateKey = InMemory::
file($privateKey->
getKeyPath(),
$privateKey->
getPassPhrase() ?? ''
);
$publicKey = InMemory::
file($publicKey->
getKeyPath(),
$publicKey->
getPassPhrase() ?? ''
);
} $configuration = Configuration::
forAsymmetricSigner( $signer,
$privateKey,
$publicKey,
$encoder,