Sha256: 2bbbde63ece83717a92974e477f64a8d605d1b63958b36389e150fc35562fe97

Contents?: true

Size: 606 Bytes

Versions: 9

Compression:

Stored size: 606 Bytes

Contents

# frozen_string_literal: true

require "cose/security_message"

module COSE
  class Recipient < SecurityMessage
    attr_reader :ciphertext, :recipients

    def self.keyword_arguments_for_initialize(decoded)
      keyword_arguments = { ciphertext: decoded[0] }

      if decoded[1]
        keyword_arguments[:recipients] = decoded[1].map { |s| COSE::Recipient.deserialize(s) }
      end

      keyword_arguments
    end

    def initialize(ciphertext:, recipients: nil, **keyword_arguments)
      super(**keyword_arguments)

      @ciphertext = ciphertext
      @recipients = recipients
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cose-1.3.1 lib/cose/recipient.rb
cose-1.3.0 lib/cose/recipient.rb
cose-1.2.1 lib/cose/recipient.rb
cose-1.2.0 lib/cose/recipient.rb
cose-1.1.0 lib/cose/recipient.rb
cose-1.0.0 lib/cose/recipient.rb
cose-0.11.0 lib/cose/recipient.rb
cose-0.10.0 lib/cose/recipient.rb
cose-0.9.0 lib/cose/recipient.rb