Class: Saml::Kit::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/saml/kit/configuration.rb

Constant Summary collapse

BEGIN_CERT =
/-----BEGIN CERTIFICATE-----/
END_CERT =
/-----END CERTIFICATE-----/

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ Configuration

Returns a new instance of Configuration.



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/saml/kit/configuration.rb', line 14

def initialize
  @signature_method = :SHA256
  @digest_method = :SHA256
  @signing_private_key_password = SecureRandom.uuid
  @encryption_private_key_password = SecureRandom.uuid
  @signing_certificate_pem, @signing_private_key_pem = SelfSignedCertificate.new(@signing_private_key_password).create
  @encryption_certificate_pem, @encryption_private_key_pem = SelfSignedCertificate.new(@encryption_private_key_password).create
  @registry = DefaultRegistry.new
  @session_timeout = 3.hours
  @logger = Logger.new(STDOUT)
end

Instance Attribute Details

#digest_method ⇒ Object

Returns the value of attribute digest_method.



8
9
10
# File 'lib/saml/kit/configuration.rb', line 8

def digest_method
  @digest_method
end

#encryption_certificate_pem ⇒ Object

Returns the value of attribute encryption_certificate_pem.



10
11
12
# File 'lib/saml/kit/configuration.rb', line 10

def encryption_certificate_pem
  @encryption_certificate_pem
end

#encryption_private_key_password ⇒ Object

Returns the value of attribute encryption_private_key_password.



10
11
12
# File 'lib/saml/kit/configuration.rb', line 10

def encryption_private_key_password
  @encryption_private_key_password
end

#encryption_private_key_pem ⇒ Object

Returns the value of attribute encryption_private_key_pem.



10
11
12
# File 'lib/saml/kit/configuration.rb', line 10

def encryption_private_key_pem
  @encryption_private_key_pem
end

#issuer ⇒ Object

Returns the value of attribute issuer.



7
8
9
# File 'lib/saml/kit/configuration.rb', line 7

def issuer
  @issuer
end

#logger ⇒ Object

Returns the value of attribute logger.



12
13
14
# File 'lib/saml/kit/configuration.rb', line 12

def logger
  @logger
end

#registry ⇒ Object

Returns the value of attribute registry.



11
12
13
# File 'lib/saml/kit/configuration.rb', line 11

def registry
  @registry
end

#session_timeout ⇒ Object

Returns the value of attribute session_timeout.



11
12
13
# File 'lib/saml/kit/configuration.rb', line 11

def session_timeout
  @session_timeout
end

#signature_method ⇒ Object

Returns the value of attribute signature_method.



8
9
10
# File 'lib/saml/kit/configuration.rb', line 8

def signature_method
  @signature_method
end

#signing_certificate_pem ⇒ Object

Returns the value of attribute signing_certificate_pem.



9
10
11
# File 'lib/saml/kit/configuration.rb', line 9

def signing_certificate_pem
  @signing_certificate_pem
end

#signing_private_key_password ⇒ Object

Returns the value of attribute signing_private_key_password.



9
10
11
# File 'lib/saml/kit/configuration.rb', line 9

def signing_private_key_password
  @signing_private_key_password
end

#signing_private_key_pem ⇒ Object

Returns the value of attribute signing_private_key_pem.



9
10
11
# File 'lib/saml/kit/configuration.rb', line 9

def signing_private_key_pem
  @signing_private_key_pem
end

Instance Method Details

#encryption_private_key ⇒ Object



46
47
48
# File 'lib/saml/kit/configuration.rb', line 46

def encryption_private_key
  OpenSSL::PKey::RSA.new(encryption_private_key_pem, encryption_private_key_password)
end

#encryption_x509 ⇒ Object



38
39
40
# File 'lib/saml/kit/configuration.rb', line 38

def encryption_x509
  Certificate.to_x509(encryption_certificate_pem)
end

#signing_private_key ⇒ Object



42
43
44
# File 'lib/saml/kit/configuration.rb', line 42

def signing_private_key
  OpenSSL::PKey::RSA.new(signing_private_key_pem, signing_private_key_password)
end

#signing_x509 ⇒ Object



34
35
36
# File 'lib/saml/kit/configuration.rb', line 34

def signing_x509
  Certificate.to_x509(signing_certificate_pem)
end

#stripped_encryption_certificate ⇒ Object



30
31
32
# File 'lib/saml/kit/configuration.rb', line 30

def stripped_encryption_certificate
  normalize(encryption_certificate_pem)
end

#stripped_signing_certificate ⇒ Object



26
27
28
# File 'lib/saml/kit/configuration.rb', line 26

def stripped_signing_certificate
  normalize(signing_certificate_pem)
end