haskell-tls / hs-certificate

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

Is there a way to sign a certificate with a private key? #124

Open eyeinsky opened 3 years ago

eyeinsky commented 3 years ago

The function objectToSignedExact looks like it could be used for signing a certificate, but (1) how would I do it if I had a RSA private key available and (2) would the result pass as a valid x509 certificate?

Also, given that the Certificate data type has a field certSignatureAlg then the public key type would need to match this, right? (as in: one must use an RSA private key for signing if the signature algorithm SignatureALG HashSHA256 PubKeyALG_RSA)

l29ah commented 3 years ago

https://github.com/l29ah/rustorion-gtk/blob/master/CertGen.hs#L47 may be helpful.