Microsoft RSA key blob

Exchange RSA keys between Microsoft CSP blob format (ExportCspBlob, ImportCspBlob of RSACryptoServiceProvider) and ruby openssl key OpenSSL::PKey::RSA

Usage

Create key from blob created by ExportCspBlob

    blob = File.binread 'msblob.bin'

    key = OpenSSL::PKey::RSA.from_mskeyblob blob

Create blob for ExportCspBlob

    key = OpenSSL::PKey::RSA.new 2048

    blob = key.to_mskeyblob
    public_blob = key.to_mskeyblob(include_private: false)

Installation

Add this line to your application's Gemfile:

gem 'mskeyblob'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mskeyblob

Contributing

  1. Fork it ( https://github.com/Ziaw/mskeyblob/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request
  1. MSDN Enhanced Provider Key BLOBs

  2. Ruby and OpenSSL