haskell-tls / hs-certificate

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

Add Monoid instances for the certificate chain types. #39

Closed ygale closed 8 years ago

ygale commented 9 years ago

Vincent, I added Monoid instances for CertificateChain and CertificateChainRaw. I originally was thinking of using this for handing chain certificates in TLS, but now I see that the chain from each file needs its own key. In any case, the Monoid instances still make sense and are natural. They at least allow you to use things like Foldable.foldMap when reading a certificate file.

So, in the end I don't really need this. But I already did the PR, so I'm sending it to you and leaving it up to you whether you want to merge it.

Regards, Yitz

ygale commented 9 years ago

The order of mappend may need to be reversed for this Monoid instance, due to #31.

vincenthz commented 9 years ago

I'm not sure that make sense, I'ld rather add something that check that it's actually a chain, than blindly appending certificate together