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/rsa_key.rb

27 lines
375 B
Ruby
Raw Normal View History

2019-09-10 12:08:23 +00:00
# frozen_string_literal: true
class RSAKey < AsymmetricKey
ALGO_CLASS = 'RSA'
2019-09-13 23:22:45 +00:00
BITS = [2048, 4096].freeze
2019-09-10 12:08:23 +00:00
###############
# Validations #
###############
2019-09-13 23:22:45 +00:00
validates :bits, inclusion: { in: BITS }
2019-09-13 23:20:47 +00:00
validates :curve, absence: true
###########
# Methods #
###########
def algo_class
ALGO_CLASS
end
def algo_variant
"#{bits} bits"
end
2019-09-10 12:08:23 +00:00
end