Module | AWS::S3::EncryptionUtils |
In: |
lib/aws/s3/encryption_utils.rb
|
@api private
UNSAFE_MSG | = | "Unsafe encryption, data is longer than key length" |
Checks for any formatting problems for keys and initialization vectors
supported with EncryptionUtils.
@param [OpenSSL::PKey::RSA, String] key Key used to encrypt.
@param [String] data Data to be encrypted.
@note Use check_encryption_materials before this method to check
formatting of keys
@return [String] Returns the data decrypted with the key given.
@param [OpenSSL::PKey::RSA, String] key Key used to encrypt.
@param [String] data Data to be encrypted.
@note Use check_encryption_materials before this method to check
formatting of keys.
@note This should not be used for data longer than the key length as
it will not be cryptographically safe.
@return [String] Returns the data encrypted with the key given.
@param [OpenSSL::Cipher] cipher The cipher with configured key and iv.
@yield [String, String] key_iv_pair A randomly generated key, iv pair
for use with the given cipher. Sets the key and iv on the cipher.
@param [Symbol] mode The encryption/decryption mode. Valid inputs are
:encrypt or :decrypt
@param [String] key Key for the cipher.
@param [String] iv IV for the cipher.
@return [OpenSSL::Cipher] Will return a configured `OpenSSL::Cipher`.