Class: HasHelpers::ServiceTrust::Key

Inherits:
ApplicationRecord show all
Defined in:
app/models/has_helpers/service_trust/key.rb

Constant Summary collapse

ENCRYPTION_ACTIVE =
respond_to?(:encrypts)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.encryption_active?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'app/models/has_helpers/service_trust/key.rb', line 29

def self.encryption_active?
  ENCRYPTION_ACTIVE
end

Instance Method Details

#persisted_backing?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'app/models/has_helpers/service_trust/key.rb', line 41

def persisted_backing?
  persisted?
end

#public_keyObject



37
38
39
# File 'app/models/has_helpers/service_trust/key.rb', line 37

def public_key
  OpenSSL::PKey.read(public_key_pem)
end

#to_opensslObject



33
34
35
# File 'app/models/has_helpers/service_trust/key.rb', line 33

def to_openssl
  OpenSSL::PKey.read(private_key_pem)
end