Module: Siren::Crypto
- Defined in:
- lib/siren/crypto.rb
Class Method Summary collapse
Class Method Details
.encrypt(data) ⇒ Object
11 12 13 14 |
# 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 ⇒ Object
6 7 8 9 |
# File 'lib/siren/crypto.rb', line 6 def self.genkeys key = JOSE::JWK.generate_key([:ec, "P-256"]) return [key, key.to_public] end |