class EnvelopeEncryptionKeyProvider

Ruby on Rails 8.1.2

Since v7.0.10

Available in: v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Implements a simple envelope encryption approach where:

  • It generates a random data-encryption key for each encryption operation.

  • It stores the generated key along with the encrypted payload. It encrypts this key with the master key provided in the active_record_encryption.primary_key credential.

This provider can work with multiple master keys. It will use the last one for encrypting.

When config.active_record.encryption.store_key_references is true, it will also store a reference to the specific master key that was used to encrypt the data-encryption key. When not set, it will try all the configured master keys looking for the right one, in order to return the right decryption key.

Inherits from

Object

Methods (defined here)

Private methods

(4) Implementation detail — not part of the public API.

Methods (inherited)

From Object (17)
From ActiveSupport::NumericWithFormat (2)

Type at least 2 characters to search.

↑↓ navigate · open · esc close