Fix BL after master emrge

This commit is contained in:
Karl Erik Õunapuu 2021-01-29 15:11:13 +02:00
parent 43e5b74668
commit c5e2ebe15e
No known key found for this signature in database
GPG key ID: C9DD647298A34764
5 changed files with 24 additions and 30 deletions

View file

@ -128,5 +128,13 @@ class Dnskey < ApplicationRecord
def bin_to_hex(s)
s.each_byte.map { |b| format('%02X', b) }.join
end
def pub_key_base64?(pub)
return unless pub&.is_a?(String)
Base64.strict_encode64(Base64.strict_decode64(pub)) == pub
rescue ArgumentError
false
end
end
end