MaterialsProviderInterfaceV2.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace Aws\Crypto;
  3. interface MaterialsProviderInterfaceV2
  4. {
  5. /**
  6. * Returns if the requested size is supported by AES.
  7. *
  8. * @param int $keySize Size of the requested key in bits.
  9. *
  10. * @return bool
  11. */
  12. public static function isSupportedKeySize($keySize);
  13. /**
  14. * Returns the wrap algorithm name for this Provider.
  15. *
  16. * @return string
  17. */
  18. public function getWrapAlgorithmName();
  19. /**
  20. * Takes an encrypted content encryption key (CEK) and material description
  21. * for use decrypting the key according to the Provider's specifications.
  22. *
  23. * @param string $encryptedCek Encrypted key to be decrypted by the Provider
  24. * for use decrypting other data.
  25. * @param string $materialDescription Material Description for use in
  26. * decrypting the CEK.
  27. * @param array $options Options for use in decrypting the CEK.
  28. *
  29. * @return string
  30. */
  31. public function decryptCek($encryptedCek, $materialDescription, $options);
  32. /**
  33. * @param string $keySize Length of a cipher key in bits for generating a
  34. * random content encryption key (CEK).
  35. * @param array $context Context map needed for key encryption
  36. * @param array $options Additional options to be used in CEK generation
  37. *
  38. * @return array
  39. */
  40. public function generateCek($keySize, $context, $options);
  41. /**
  42. * @param string $openSslName Cipher OpenSSL name to use for generating
  43. * an initialization vector.
  44. *
  45. * @return string
  46. */
  47. public function generateIv($openSslName);
  48. }