haskell-tls / hs-certificate

Certificate and Key Reader/Writer in haskell
60 stars 57 forks source link

Data.X509.PrivateKey.PrivKey is not an instance of ASN1Object #55

Closed derekelkins closed 5 years ago

derekelkins commented 9 years ago

In case there's another suggested way of doing it, my use-case is to produce in-memory RSA private keys in PEM format.

aloiscochard commented 8 years ago

I plan to tackle this one, I would love being able to generate RSA keys in .pem file in pure Haskell.

It seems to me that writing the dual of dsaFromASN1 and rsaFromASN1 should be enough to then declare ASN1 instances for PrivKey.

duairc commented 6 years ago

I've written code that does this as part of an unrelated project here. If somebody wants to take that and make a pull request to upstream it that would be great. I know it's really something I should do myself, but it is what it is.

BTW, that project is licensed MPL-2.0, while this is BSD3. However if somebody wants to upstream the Data.X509.IO module, I'll license that module as BSD3 for that purpose.

chris-martin commented 6 years ago

I've submitted #98 which pulls in @duairc's implementations of ASN1Object for PrivKey.