Class: SignatureDfe::SSL
- Inherits:
-
Object
- Object
- SignatureDfe::SSL
- Includes:
- AbstractClass
- Defined in:
- lib/signature_dfe/ssl.rb
Class Attribute Summary collapse
-
.config ⇒ Object
readonly
Returns the value of attribute config.
Class Method Summary collapse
Methods included from AbstractClass
Class Attribute Details
.config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/signature_dfe/ssl.rb', line 8 def config @config end |
Class Method Details
.cert ⇒ Object
16 17 18 19 |
# File 'lib/signature_dfe/ssl.rb', line 16 def self.cert self.test unless defined?(@pk) @cert.to_s.gsub(/-----[A-Z]+ CERTIFICATE-----/, '').strip end |
.sign(content, sign_method = OpenSSL::Digest.new('SHA1')) ⇒ Object
11 12 13 14 |
# File 'lib/signature_dfe/ssl.rb', line 11 def self.sign(content, sign_method = OpenSSL::Digest.new('SHA1')) self.test unless defined?(@pk) @pk.sign sign_method, content end |
.test ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/signature_dfe/ssl.rb', line 22 def test set_up test_pkc12 if config.pkcs12 test_pem if config.pkey && !config.pkcs12 true rescue OpenSSL::PKey::RSAError error "Wrong password for '#{config.pkey}'" end |