temp = hash
keys[0..-2].each do |k|
temp = temp.send(:'[]', k)
end
temp.send(:'[]=', keys.last, 10)
$ openssl genpkey -algorithm gost2001 -pkeyopt paramset:A -out seckey.pem
$ cat seckey.pem
-----BEGIN PRIVATE KEY-----
MEYCAQAwHAYGKoUDAgITMBIGByqFAwICIwEGByqFAwICHgEEIwIhAJ+m75X82GvN
kzuffIZaw8/L4VZdYtb1GHDekFQSFWWz
-----END PRIVATE KEY-----