5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 16:06:22 +00:00

feat: generar la llave privada #14169

This commit is contained in:
f 2023-08-29 17:49:25 -03:00
parent c6c638fb60
commit 4de3352950
No known key found for this signature in database

View file

@ -7,6 +7,17 @@ class Site
included do
encrypts :private_key_pem
before_save :generate_private_key_pem!, unless: :private_key_pem?
private
# Genera la llave privada y la almacena
#
# @return [nil]
def generate_private_key_pem!
self.private_key_pem ||= DistributedPress::V1::Social::Client.new(public_key_url: nil, key_size: 2048).private_key.export
end
end
end
end