module Siren::Crypto
Public Class Methods
encrypt(data)
click to toggle source
# File lib/siren/crypto.rb, line 11 def self.encrypt (data) @key ||= JOSE::JWK.from_file("public.jwk") @key.box_encrypt(data)[0].compact end
genkeys()
click to toggle source
# File lib/siren/crypto.rb, line 6 def self.genkeys key = JOSE::JWK.generate_key([:ec, "P-256"]) return [key, key.to_public] end