Sha256: f5ff250a5a3f36e77eaa439d1f4b4a8b4901f1a14b545fa1e1dba22df6c02ade

Contents?: true

Size: 454 Bytes

Versions: 96

Compression:

Stored size: 454 Bytes

Contents

module PkeyReader
  def read_pkey(filecontent, passphrase)
    raise_if_default(passphrase)

    OpenSSL::PKey.read(filecontent, passphrase)
  rescue OpenSSL::PKey::PKeyError
    raise Inspec::Exceptions::ResourceFailed, 'passphrase error'
  end

  def raise_if_default(passphrase)
    if passphrase.is_a? Inspec::Attribute::DEFAULT_ATTRIBUTE
      raise Inspec::Exceptions::ResourceFailed, 'Please provide default value for attribute'
    end
  end
end

Version data entries

96 entries across 96 versions & 2 rubygems

Version Path
inspec-core-3.6.6 lib/utils/pkey_reader.rb
inspec-3.6.6 lib/utils/pkey_reader.rb
inspec-core-3.6.4 lib/utils/pkey_reader.rb
inspec-3.6.4 lib/utils/pkey_reader.rb
inspec-core-2.3.28 lib/utils/pkey_reader.rb
inspec-2.3.28 lib/utils/pkey_reader.rb
inspec-core-3.6.2 lib/utils/pkey_reader.rb
inspec-3.6.2 lib/utils/pkey_reader.rb
inspec-core-3.5.0 lib/utils/pkey_reader.rb
inspec-3.5.0 lib/utils/pkey_reader.rb
inspec-core-3.4.1 lib/utils/pkey_reader.rb
inspec-3.4.1 lib/utils/pkey_reader.rb
inspec-core-3.3.14 lib/utils/pkey_reader.rb
inspec-3.3.14 lib/utils/pkey_reader.rb
inspec-core-3.2.6 lib/utils/pkey_reader.rb
inspec-3.2.6 lib/utils/pkey_reader.rb
inspec-core-3.1.3 lib/utils/pkey_reader.rb
inspec-3.1.3 lib/utils/pkey_reader.rb
inspec-core-3.0.64 lib/utils/pkey_reader.rb
inspec-3.0.64 lib/utils/pkey_reader.rb