require 'openssl'

describe "OpenSSL::PKey::RSA.new" do
  it "constructs a private key with correct value" do
    key = "-----BEGIN RSA PRIVATE KEY-----\nProc-Type: 4,ENCRYPTED\nDEK-Info: DES-EDE3-CBC,212892DF3709856D\n\nxGMDk+el+eTIKK579whf6BM6uVu9XDWKFi9E9JVUo0NqzlbuTgEmhdEXsSUu+di2\nOOg3O4yckqMGVRFeLvuwNfL1t+wJIa4RhE23d4nk/n0PINDEQKtQU1HmMCVuOrXH\nHmsjTdShzB4sUFTxxKXybZkecdrH9lHb9sDGIR0M9soaPUhhnb1aoZ+2hlyy++eH\nh3zL1W+J0a3OK64Oh1GZNgSyrZMiVAhfd7gnrOt6sy6PH0EEJgn1H1MJpfmmgc+D\n+KlnFvivmpRT5jyIJyd0uWHA/Y4jZwZKoL9QN1jeDRlquWhrbKaKUSF0A2jRrW7W\n7vErmzs7S/GQLXtu/RqztT7BBWeCHx6wpeDy6FzpMcYlspfHOVbrNs7pZyK1Zw4E\n9YfTbjaMvtT+VaBB9WheiZ7+UWR59usB3u3mMK50yYf3CXW4BM7gnKP9/r3Pm6Xh\nXKKHxHwr3TcaT7vNZavwMQfrw/ngnVoS1kLNec7C5Sfwcy/0FsAESrIOoI7xj/0m\n+wyqmJZZXTQtn04I7MFF7RZ8evmbRcLJ5dFAke83GB4SR9dFu4Fbgv3juP/yjyZ/\nIpZmpBdPUdkWQjL61R5WMHwrnnK+QUvCmL/A3Jdxn81qk3gNleaF93f54esrdQo5\nLMsKc1Q+QGA/N1QW1tCcSpLUsOx/0ohYQiAaZZ6JpNp3szkVPQLV2hYwgWraLlJi\nYqVKTFXL3z9Q2SVYDkMqBwrVfHQ1fvZbWRH4CTw4yOIYaiOO7fIoduu2mmz8hUgc\n9xKe0jDKX0OnJ6M0No/+24YAT1gbJAaaH84CUhxNIOJTvtIJ7LJjyREAaO64HPT3\nbQ6Pk8aleBzxSOTXclfC9ArtOVEqG00BkZYqXb6axq7udnTJYvmI83mWzONQGOlM\nLswZKv6s4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+YaUMyzvkbKZMCLv4VZxAEW7YgDv1ZcSr+HIn3IJqVA5HbNa\n7QIDAQAB\n-----END PUBLIC KEY-----\n"
    finished_key = OpenSSL::PKey::RSA.new(key, 'password')
    expect(finished_key.to_s.length).to eq(1675)
  end
end
