Class: Rex::Proto::X509::Request
- Inherits:
-
Object
- Object
- Rex::Proto::X509::Request
- Defined in:
- lib/rex/proto/x509/request.rb
Class Method Summary collapse
Class Method Details
.create_csr(private_key, cn, algorithm = 'SHA256') {|request| ... } ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/rex/proto/x509/request.rb', line 4 def self.create_csr(private_key, cn, algorithm = 'SHA256') request = OpenSSL::X509::Request.new request.subject = OpenSSL::X509::Name.new([ ['CN', cn, OpenSSL::ASN1::UTF8STRING] ]) request.public_key = private_key.public_key yield request if block_given? request.sign(private_key, OpenSSL::Digest.new(algorithm)) request end |