diff --git a/lib/CryptoTypes/AlgorithmIdentifier/Signature/SignatureAlgorithmIdentifierFactory.php b/lib/CryptoTypes/AlgorithmIdentifier/Signature/SignatureAlgorithmIdentifierFactory.php index 8c63ff4..121254f 100644 --- a/lib/CryptoTypes/AlgorithmIdentifier/Signature/SignatureAlgorithmIdentifierFactory.php +++ b/lib/CryptoTypes/AlgorithmIdentifier/Signature/SignatureAlgorithmIdentifierFactory.php @@ -6,7 +6,7 @@ use Sop\CryptoTypes\AlgorithmIdentifier\AlgorithmIdentifier; use Sop\CryptoTypes\AlgorithmIdentifier\AlgorithmIdentifierFactory; -use Sop\CryptoTypes\AlgorithmIdentifier\Feature\AsymmetricCryptoAlgorithmIdentifier; +use Sop\CryptoTypes\AlgorithmIdentifier\Feature\AlgorithmIdentifierType; use Sop\CryptoTypes\AlgorithmIdentifier\Feature\HashAlgorithmIdentifier; use Sop\CryptoTypes\AlgorithmIdentifier\Feature\SignatureAlgorithmIdentifier; @@ -50,13 +50,13 @@ abstract class SignatureAlgorithmIdentifierFactory * Get signature algorithm identifier of given asymmetric cryptographic type * utilizing given hash algorithm. * - * @param AsymmetricCryptoAlgorithmIdentifier $crypto_algo Cryptographic algorithm identifier, eg. RSA or EC + * @param AlgorithmIdentifierType $crypto_algo Cryptographic algorithm identifier, eg. RSA or EC * @param HashAlgorithmIdentifier $hash_algo Hash algorithm identifier * * @throws \UnexpectedValueException */ public static function algoForAsymmetricCrypto( - AsymmetricCryptoAlgorithmIdentifier $crypto_algo, + AlgorithmIdentifierType $crypto_algo, HashAlgorithmIdentifier $hash_algo): SignatureAlgorithmIdentifier { switch ($crypto_algo->oid()) { diff --git a/lib/CryptoTypes/Asymmetric/PrivateKey.php b/lib/CryptoTypes/Asymmetric/PrivateKey.php index c3b4bea..41f0b6d 100644 --- a/lib/CryptoTypes/Asymmetric/PrivateKey.php +++ b/lib/CryptoTypes/Asymmetric/PrivateKey.php @@ -44,11 +44,11 @@ public function privateKeyData(): string } /** - * Get the private key as a PrivateKeyInfo type. + * Get the private key as a OneAsymmetricKey type. */ - public function privateKeyInfo(): PrivateKeyInfo + public function privateKeyInfo(): OneAsymmetricKey { - return PrivateKeyInfo::fromPrivateKey($this); + return OneAsymmetricKey::fromPrivateKey($this); } /** @@ -66,7 +66,7 @@ public static function fromPEM(PEM $pem) case PEM::TYPE_EC_PRIVATE_KEY: return EC\ECPrivateKey::fromDER($pem->data()); case PEM::TYPE_PRIVATE_KEY: - return PrivateKeyInfo::fromDER($pem->data())->privateKey(); + return OneAsymmetricKey::fromDER($pem->data())->privateKey(); } throw new \UnexpectedValueException( 'PEM type ' . $pem->type() . ' is not a valid private key.');