Skip to content

Construct an RSA Key pair from raw private componentsΒ #791

@Stupremee

Description

@Stupremee

Problem:

It is not possible to construct an rsa::KeyPair from it's raw private components (d, p, q, etc).
In ring I'm able to use KeyPair::from_components method to create an RSA Key from the raw numbers.

I need this API to parse a JWK into a rsa::KeyPair to sign a JWS.

Solution:

Implement the same API ring has, using a PrivateKeyComponents struct and new function

Workaround:

My current workaround includes constructing the private key in DER format using an ASN1 crate, and then use the KeyPair::from_der function. But this is very expensive compared to just creating the key directly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions