RsaKeyPairClient.php 740 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace AlibabaCloud\Client\Clients;
  3. use AlibabaCloud\Client\Exception\ClientException;
  4. use AlibabaCloud\Client\Signature\ShaHmac1Signature;
  5. use AlibabaCloud\Client\Credentials\RsaKeyPairCredential;
  6. /**
  7. * Use the RSA key pair to complete the authentication (supported only on Japanese site)
  8. *
  9. * @package AlibabaCloud\Client\Clients
  10. */
  11. class RsaKeyPairClient extends Client
  12. {
  13. /**
  14. * @param string $publicKeyId
  15. * @param string $privateKeyFile
  16. *
  17. * @throws ClientException
  18. */
  19. public function __construct($publicKeyId, $privateKeyFile)
  20. {
  21. parent::__construct(
  22. new RsaKeyPairCredential($publicKeyId, $privateKeyFile),
  23. new ShaHmac1Signature()
  24. );
  25. }
  26. }