HsOpenSSL-0.11.7.9: Partial OpenSSL binding for Haskell

Safe Haskell | None
Language | Haskell2010

OpenSSL.DER

Description

Encoding and decoding of RSA keys using the ASN.1 DER format

Synopsis

- toDERPub :: RSAKey k => k -> ByteString
- fromDERPub :: ByteString -> Maybe RSAPubKey
- toDERPriv :: RSAKeyPair -> ByteString
- fromDERPriv :: RSAKey k => ByteString -> Maybe k

# Documentation

toDERPub Source #

Arguments

:: RSAKey k |
=> k | You can pass either `RSAPubKey` or `RSAKeyPair` because both contain the necessary information.
-> ByteString | The public key information encoded in ASN.1 DER

Dump a public key to ASN.1 DER format

fromDERPub :: ByteString -> Maybe RSAPubKey Source #

Parse a public key from ASN.1 DER format

toDERPriv :: RSAKeyPair -> ByteString Source #

Dump a private key to ASN.1 DER format

fromDERPriv Source #

Arguments

:: RSAKey k |
=> ByteString | The private key information encoded in ASN.1 DER
-> Maybe k | This can return either `RSAPubKey` or `RSAKeyPair` because there’s sufficient information for both.

Parse a private key from ASN.1 DER format