add ability to use own signing cert

This commit is contained in:
Alex Turchyn
2023-08-31 01:12:24 +03:00
parent c9f39e7b1a
commit d3a5f36555
17 changed files with 296 additions and 78 deletions
+15
View File
@@ -87,4 +87,19 @@ module GenerateCertificate
[cert, key]
end
def load_pkcs(cert_data)
cert = OpenSSL::X509::Certificate.new(cert_data['cert'])
key = OpenSSL::PKey::RSA.new(cert_data['key'])
sub_ca = OpenSSL::X509::Certificate.new(cert_data['sub_ca'])
root_ca = OpenSSL::X509::Certificate.new(cert_data['root_ca'])
OpenSSL::PKCS12.create(
'',
'',
key,
cert,
[sub_ca, root_ca]
)
end
end