All pastes #982678 Raw Edit

Mine

public text v1 · immutable
·published 2008-04-12 19:52 UTC
rendered paste body
require 'uca'

cn =  [ ["CN", "testclient"] ]
uca = UCA::UCA.new([ ["CN", "test CA"] ], "Test", Proc.new { |flag| "12345" })
rsa, csr = uca.generate_csr(1024, cn)
cert = uca.sign_csr(csr)
raise "Verification failed" unless csr.verify(rsa.public_key)
print cert.to_pem