lib/saml/kit/configuration.rb in saml-kit-0.2.2 vs lib/saml/kit/configuration.rb in saml-kit-0.2.3

- old
+ new

@@ -1,11 +1,8 @@ module Saml module Kit class Configuration - BEGIN_CERT=/-----BEGIN CERTIFICATE-----/ - END_CERT=/-----END CERTIFICATE-----/ - attr_accessor :issuer attr_accessor :signature_method, :digest_method attr_accessor :signing_certificate_pem, :signing_private_key_pem, :signing_private_key_password attr_accessor :encryption_certificate_pem, :encryption_private_key_pem, :encryption_private_key_password attr_accessor :registry, :session_timeout @@ -21,37 +18,23 @@ @registry = DefaultRegistry.new @session_timeout = 3.hours @logger = Logger.new(STDOUT) end - def stripped_signing_certificate - normalize(signing_certificate_pem) + def signing_certificate + Saml::Kit::Certificate.new(signing_certificate_pem, use: :signing) end - def stripped_encryption_certificate - normalize(encryption_certificate_pem) + def encryption_certificate + Saml::Kit::Certificate.new(encryption_certificate_pem, use: :encryption) end - def signing_x509 - Certificate.to_x509(signing_certificate_pem) - end - - def encryption_x509 - Certificate.to_x509(encryption_certificate_pem) - end - def signing_private_key OpenSSL::PKey::RSA.new(signing_private_key_pem, signing_private_key_password) end def encryption_private_key OpenSSL::PKey::RSA.new(encryption_private_key_pem, encryption_private_key_password) - end - - private - - def normalize(certificate) - certificate.to_s.gsub(BEGIN_CERT, '').gsub(END_CERT, '').gsub(/\n/, '') end end end end