Sha256: 6e934d446b61275f0c1461f348d9469e18d54a929447bf92db1d262d319a7498
Contents?: true
Size: 534 Bytes
Versions: 13
Compression:
Stored size: 534 Bytes
Contents
# frozen_string_literal: true module Decidim module Elections # # Decorator for trustee # class TrusteePresenter < SimpleDelegator def trustee __getobj__ end def public_key_thumbprint @public_key_thumbprint ||= jwk_thumbprint(JSON.parse(trustee.public_key)) if trustee.public_key.present? end private def jwk_thumbprint(key) Base64.urlsafe_encode64(Digest::SHA256.digest(key.slice("e", "kty", "n").to_json), padding: false) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems