Sha256: 9a10eca8d6522602ab5acd4bc7966612b2e4eadbd49bdcdafbfe3677bfa74b98
Contents?: true
Size: 664 Bytes
Versions: 13
Compression:
Stored size: 664 Bytes
Contents
require 'ritm/certs/ca' module Doraemon class Cert def self.cert_root File.join(Dir.home, ".doraemon") end def self.cert_path File.join(Cert.cert_root, "doraemon.crt") end def self.key_path File.join(Cert.cert_root, "doraemon.key") end def self.generate_cert crt_root = Cert.cert_root Dir.mkdir(crt_root) unless Dir.exist?(crt_root) if !File.exist?(Cert.cert_path) ca = Ritm::CA.create common_name: 'Doraemon' File.write(Cert.cert_path, ca.pem) File.write(Cert.key_path, ca.private_key.to_s) puts 'doraemon.crt generate success.' end end end end
Version data entries
13 entries across 13 versions & 1 rubygems