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

27 lines
396 B
Ruby

# frozen_string_literal: true
class EcurveKey < AsymmetricKey
ALGO_CLASS = 'Elliptic curve'
CURVES = %w[prime256v1 secp384r1].freeze
###############
# Validations #
###############
validates :curve, inclusion: { in: CURVES }
validates :bits, absence: true
###########
# Methods #
###########
def algo_class
ALGO_CLASS
end
def algo_variant
curve
end
end