I only have a few minutes and can't guarantee this is complete or tested,
but maybe it will help.

All you really need is the modulus and exponent from the key.  You get
these via "GetAttribData" in trousers:

tss_result = Tspi_GetAttribData(hBind_Key, TSS_TSPATTRIB_RSAKEY_INFO,
    TSS_TSPATTRIB_KEYINFO_RSA_MODULUS, &m_size, &m);

tss_result = Tspi_GetAttribData(hBind_Key, TSS_TSPATTRIB_RSAKEY_INFO,
        TSS_TSPATTRIB_KEYINFO_RSA_EXPONENT, &e_size, &e);


Then something like this:

    RSA *rsa = RSA_new();
    rsa->e = BN_bin2bn(e, e_size, rsa->e);
    rsa->n = BN_bin2bn(m, m_size, rsa->n);

-Tadd


On Tue, Mar 22, 2016 at 9:12 PM eye two are <[email protected]> wrote:

> Hi, i am trying to convert a TPM key which i obtained from a particular
> UUID into an RSA struct to be used with OpenSSL. Does anyone have any
> example code on how to do it?
>
> ------------------------------------------------------------------------------
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
> _______________________________________________
> TrouSerS-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/trousers-users
>
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
TrouSerS-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/trousers-users

Reply via email to