1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/models/ecurve_key.rb

26 lines
370 B
Ruby
Raw Normal View History

2019-09-13 19:20:47 -04:00
# frozen_string_literal: true
class EcurveKey < AsymmetricKey
2019-09-13 19:22:45 -04:00
CURVES = %w[prime256v1 secp384r1].freeze
2019-09-13 19:20:47 -04:00
###############
# Validations #
###############
2019-09-13 19:22:45 -04:00
validates :curve, inclusion: { in: CURVES }
2019-09-13 19:20:47 -04:00
validates :bits, absence: true
###########
# Methods #
###########
def algo_class
'Elliptic curve'
end
def algo_variant
curve
end
2019-09-13 19:20:47 -04:00
end