config root man

Current Path : /compat/linux/proc/self/root/usr/local/share/examples/ruby18/openssl/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //compat/linux/proc/self/root/usr/local/share/examples/ruby18/openssl/cert2text.rb

#!/usr/bin/env ruby

require 'openssl'
include OpenSSL::X509

def cert2text(cert_str)
  [Certificate, CRL, Request].each do |klass|
    begin
      puts klass.new(cert_str).to_text
      return
    rescue
    end
  end
  raise ArgumentError.new('Unknown format.')
end

if ARGV.empty?
  cert2text(STDIN.read)
else
  ARGV.each do |file|
    cert2text(File.read(file))
  end
end

Man Man