{"action":"created","issue":{"url":"https://api.github.com/repos/libtom/libtomcrypt/issues/71","labels_url":"https://api.github.com/repos/libtom/libtomcrypt/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/libtom/libtomcrypt/issues/71/comments","events_url":"https://api.github.com/repos/libtom/libtomcrypt/issues/71/events","html_url":"https://github.com/libtom/libtomcrypt/issues/71","id":96913822,"number":71,"title":"Importing Binary Private Key To RSA_KEY","user":{"login":"EclipseStudios","id":2966383,"avatar_url":"https://avatars.githubusercontent.com/u/2966383?v=3","gravatar_id":"","url":"https://api.github.com/users/EclipseStudios","html_url":"https://github.com/EclipseStudios","followers_url":"https://api.github.com/users/EclipseStudios/followers","following_url":"https://api.github.com/users/EclipseStudios/following{/other_user}","gists_url":"https://api.github.com/users/EclipseStudios/gists{/gist_id}","starred_url":"https://api.github.com/users/EclipseStudios/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EclipseStudios/subscriptions","organizations_url":"https://api.github.com/users/EclipseStudios/orgs","repos_url":"https://api.github.com/users/EclipseStudios/repos","events_url":"https://api.github.com/users/EclipseStudios/events{/privacy}","received_events_url":"https://api.github.com/users/EclipseStudios/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/libtom/libtomcrypt/labels/Invalid","name":"Invalid","color":"e11d21"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-23T21:58:26Z","updated_at":"2015-07-28T09:09:28Z","closed_at":"2015-07-28T06:54:11Z","body":"I currently have all the parameters to an RSA key, but find it impossible to import them to the rsa_key parameter. For instance, in C# I simply do this:\r\n\r\n            RSACryptoServiceProvider Key = new RSACryptoServiceProvider();\r\n            RSAParameters parameters = new RSAParameters();\r\n            reader.Seek(0x28C);\r\n            parameters.Exponent = reader.ReadBytes(0x4);\r\n            reader.Seek(0x8, SeekOrigin.Current);\r\n            parameters.Modulus = Conversions.FlipBytesBy8(reader.ReadBytes(0x80));\r\n            parameters.P = Conversions.FlipBytesBy8(reader.ReadBytes(0x40));\r\n            parameters.Q = Conversions.FlipBytesBy8(reader.ReadBytes(0x40));\r\n            parameters.DP = Conversions.FlipBytesBy8(reader.ReadBytes(0x40));\r\n            parameters.DQ = Conversions.FlipBytesBy8(reader.ReadBytes(0x40));\r\n            parameters.InverseQ = Conversions.FlipBytesBy8(reader.ReadBytes(0x40));\r\n            parameters.D = new byte[0x80];\r\n            Key.ImportParameters(parameters);\r\n\r\nBut in C, it's not possible to just set the void* parameters, since I'm assuming they use some sort of big integer type that I cannot find. I would like to some how change the data to whatever type of format rsa_import uses."},"comment":{"url":"https://api.github.com/repos/libtom/libtomcrypt/issues/comments/125513240","html_url":"https://github.com/libtom/libtomcrypt/issues/71#issuecomment-125513240","issue_url":"https://api.github.com/repos/libtom/libtomcrypt/issues/71","id":125513240,"user":{"login":"sjaeckel","id":294374,"avatar_url":"https://avatars.githubusercontent.com/u/294374?v=3","gravatar_id":"","url":"https://api.github.com/users/sjaeckel","html_url":"https://github.com/sjaeckel","followers_url":"https://api.github.com/users/sjaeckel/followers","following_url":"https://api.github.com/users/sjaeckel/following{/other_user}","gists_url":"https://api.github.com/users/sjaeckel/gists{/gist_id}","starred_url":"https://api.github.com/users/sjaeckel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjaeckel/subscriptions","organizations_url":"https://api.github.com/users/sjaeckel/orgs","repos_url":"https://api.github.com/users/sjaeckel/repos","events_url":"https://api.github.com/users/sjaeckel/events{/privacy}","received_events_url":"https://api.github.com/users/sjaeckel/received_events","type":"User","site_admin":false},"created_at":"2015-07-28T09:09:28Z","updated_at":"2015-07-28T09:09:28Z","body":"Hint: I'd have a look at `mp_read_unsigned_bin()`"}}