fix pdf signature validation and certs

This commit is contained in:
Alex Turchyn
2023-08-31 01:49:14 +03:00
parent c098e61947
commit c4daf8ed49
2 changed files with 9 additions and 4 deletions
@@ -7,8 +7,11 @@ class VerifyPdfSignatureController < ApplicationController
HexaPDF::Document.new(io: file.open)
end
cert_data = EncryptedConfig.find_by(account: current_account,
key: EncryptedConfig::ESIGN_CERTS_KEY)&.value || {}
cert_data = if Docuseal.multitenant?
Docuseal::CERTS
else
EncryptedConfig.find_by(account:, key: EncryptedConfig::ESIGN_CERTS_KEY)&.value || {}
end
default_pkcs = GenerateCertificate.load_pkcs(cert_data)