Sha256: 6322b7d2c9e0a43afb084201b70c3aafee47bfad704b8cfb856ed13d890539f5

Contents?: true

Size: 830 Bytes

Versions: 22

Compression:

Stored size: 830 Bytes

Contents

FactoryGirl.define do
  factory :metasploit_credential_ssh_key,
          class: Metasploit::Credential::SSHKey do
    transient do
      key_type { generate :metasploit_credential_ssh_key_key_type }
      # key size tuned for speed.  DO NOT use for production, it is below current recommended key size of 2048
      key_size { 512 }
    end

    data {
      key_class = OpenSSL::PKey.const_get(key_type)
      key_class.generate(key_size).to_s
    }

    factory :metasploit_credential_dsa_key do
      transient do
        key_type :DSA
      end
    end

    factory :metasploit_credential_rsa_key do
      transient do
        key_type :RSA
      end
    end
  end

  metasploit_credential_ssh_key_key_types = [:DSA, :RSA]
  sequence :metasploit_credential_ssh_key_key_type, metasploit_credential_ssh_key_key_types.cycle
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
metasploit-credential-2.0.14 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-2.0.13 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-2.0.12 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-2.0.11 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-2.0.10 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-2.0.9 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-2.0.8 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-2.0.7 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-2.0.6 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-2.0.5 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-2.0.4 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-2.0.3 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-2.0.2 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-2.0.1 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-2.0.0 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-1.1.0 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-1.0.1 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-1.0.0 spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-1.0.0.pre.rails.pre.4.0c spec/factories/metasploit/credential/ssh_keys.rb
metasploit-credential-1.0.0.pre.rails.pre.4.0b spec/factories/metasploit/credential/ssh_keys.rb