Module: Imagekitio::CryptoUtils Private

Defined in:
lib/imagekitio/helpers/crypto_utils.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Crypto utilities for ImageKit SDK Provides HMAC-SHA1 functionality for URL signing and authentication

Class Method Summary collapse

Class Method Details

.create_hmac_sha1(key, data) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Creates an HMAC-SHA1 hash

Parameters:

  • key (String)

    The secret key for HMAC generation

  • data (String)

    The data to be signed

Returns:

  • (String)

    Hex-encoded HMAC-SHA1 hash

Raises:

  • (StandardError)

    if HMAC generation fails



18
19
20
21
22
# File 'lib/imagekitio/helpers/crypto_utils.rb', line 18

def create_hmac_sha1(key, data)
  OpenSSL::HMAC.hexdigest("SHA1", key, data)
rescue StandardError => e
  raise StandardError, "Failed to generate HMAC-SHA1 signature: #{e.message}"
end