Method: Kennedy::Ticket.from_encrypted

Defined in:
lib/kennedy/ticket.rb

.from_encrypted(args = {}) ⇒ Object

Decrypts a ticket from the given arguments

Parameters:

  • args (Hash) (defaults to: {})

    The arguments to build the ticket with

Options Hash (args):

  • :data (String)

    An encrypted ticket

  • :iv (String)

    An IV to use to decrypt the ticket

  • :passphrase (String)

    A passphrase to use to decrypt the ticket



37
38
39
40
41
42
# File 'lib/kennedy/ticket.rb', line 37

def self.from_encrypted(args = {})
  data = args[:data] || raise(ArgumentError, "Data must be given as :data")
  ticket = new(:iv => args[:iv], :passphrase => args[:passphrase])
  ticket.decrypt(data)
  ticket
end