Sha256: e6cd4a682594715dd497a8b779958a90b3803b217dfb6d88f97398d0f48c1300
Contents?: true
Size: 1007 Bytes
Versions: 3
Compression:
Stored size: 1007 Bytes
Contents
#!/usr/bin/env ruby require 'rubygems' require 'r509' if ARGV[0].nil? then puts "CSR and certificate parsing using r509 v#{R509::VERSION}." puts "Usage: r509-parse <cert or csr>" else begin csr = R509::CSR.load_from_file ARGV[0] rescue end if not csr.nil? puts "Subject: #{csr.subject}" puts "Algorithm: #{csr.signature_algorithm}" puts "SAN Names: #{csr.san.names.map { |n| n.value }.join(" , ")}" else begin cert = R509::Cert.load_from_file ARGV[0] rescue end if not cert.nil? puts "Subject: #{cert.subject}" puts "Issuer: #{cert.issuer}" puts "Algorithm: #{cert.signature_algorithm}" puts "SAN Names: #{cert.san.names.map { |n| n.value }.join(" , ")}" unless cert.san.nil? puts "Not Before: #{cert.not_before}" puts "Not After: #{cert.not_after}" puts "Serial (Hex): #{cert.hexserial}" puts "Serial (Decimal): #{cert.serial}" else puts "Failed to parse CSR or certificate" end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
r509-0.10.0 | bin/r509-parse |
r509-0.9.2 | bin/r509-parse |
r509-0.9.1 | bin/r509-parse |