GaloisInc / RSA

Haskell RSA Library
Other
20 stars 7 forks source link

PublicKey contructor #6

Closed kazu-yamamoto closed 10 years ago

kazu-yamamoto commented 11 years ago

Recent RSA stopped exporting the PublicKey constructor.

I use it to create a RSA public key from pre-known parameters, for instance, DKIM information on DNS. It seems to me there is no API to create PublicKey except generating a key pair.

I would like to re-export PublicKey or provide APIs to create a public key.

The same discussion should be applied to a secret key.

acw commented 10 years ago

The current version of the RSA library uses the PublicKey structure provided by Crypto.Types.PubKey.RSA from the crypto-pubkey-types library. You should be able to construct PublicKeys from there.

I chose not to re-export the constructors because ... well, because I liked the idea of them being a bit more private by default. However, you should be able to use the Crypto.Types.PubKey.RSA constructor and accessors with no problem. (Also, I'm not adding another dependency to your system because you were already including the package transitively.)

If that solution isn't good enough, for whatever reason, re-open this ticket and tell me why. I can be convinced to change my mind if you have a good example.

kazu-yamamoto commented 10 years ago

This is what I want to know. Thanks.