Skip to content

Instantly share code, notes, and snippets.

@cmouse
Created January 10, 2016 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmouse/bf4671c22d18d8a5c8df to your computer and use it in GitHub Desktop.
Save cmouse/bf4671c22d18d8a5c8df to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
key = File.read("input.der").force_encoding('ascii-8bit')
# determine key size
File.open("ssl-parameters.dat", "wb") do |f|
f.write [4096, key.size].pack 'll'
f.write key
f.write [0].pack 'l'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment