Class: PQCrypto::Seal::RecipientRebuilder
- Inherits:
-
Object
- Object
- PQCrypto::Seal::RecipientRebuilder
- Defined in:
- lib/pq_crypto/seal/core.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(envelope, credentials:, recipients:, limits:) ⇒ RecipientRebuilder
constructor
A new instance of RecipientRebuilder.
Constructor Details
#initialize(envelope, credentials:, recipients:, limits:) ⇒ RecipientRebuilder
Returns a new instance of RecipientRebuilder.
90 91 92 93 94 |
# File 'lib/pq_crypto/seal/core.rb', line 90 def initialize(envelope, credentials:, recipients:, limits:) @envelope = Envelope.parse(envelope, limits: limits) @credentials = credentials @recipients = KeyMaterial.public_keys(recipients) end |
Instance Method Details
#call ⇒ Object
96 97 98 99 100 101 102 103 |
# File 'lib/pq_crypto/seal/core.rb', line 96 def call Format.validate_capacity!(@envelope.header.recipient_capacity, @recipients.length) dek = @envelope.unwrap_dek(@credentials) @envelope.verify_payload!(dek) @envelope.replace_section(build_section(dek)) ensure Secrets.wipe!(dek) end |