create rsa key instance from parameters

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

create rsa key instance from parameters

Scott Walters
Hi,

I've been trying to find a way to create a RSA key instance using predefined
values for all the numberic fields involved.  I need to do this because I
already have a key pair that I'm using from c# and I need to encrypt/decrypt
uwing the same key from Java. I saw the RSAPrivateCrtKeyParameters class in
the docs, which stores the fields I'm interested in, but when I grep the
javadocs, I don't see where I can use it.  Can someone point me in the right
direction?

Thanks,
Scott

_________________________________________________________________
Don?t just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


Reply | Threaded
Open this post in threaded view
|

Re: create rsa key instance from parameters

David Hook-4

If you're using the JCE the class you are after is the
java.security.spec.RSAPrivateCrtKeySpec.

The RSAPrivateCrtKeyParameters class is only for use with the light
weight API.

You can find examples of the use of both classes by looking in the test
packages for the jce and the crypto api respectively.

Regards,

David

On Tue, 2005-06-21 at 08:21 -0500, Scott Walters wrote:

> Hi,
>
> I've been trying to find a way to create a RSA key instance using predefined
> values for all the numberic fields involved.  I need to do this because I
> already have a key pair that I'm using from c# and I need to encrypt/decrypt
> uwing the same key from Java. I saw the RSAPrivateCrtKeyParameters class in
> the docs, which stores the fields I'm interested in, but when I grep the
> javadocs, I don't see where I can use it.  Can someone point me in the right
> direction?
>
> Thanks,
> Scott
>
> _________________________________________________________________
> Dont just search. Find. Check out the new MSN Search!
> http://search.msn.click-url.com/go/onm00200636ave/direct/01/
>
>