HsOpenSSL-0.11.7.9: Partial OpenSSL binding for Haskell

Safe Haskell | None
Language | Haskell2010

OpenSSL.EVP.PKey

Contents

- Orphan instances

Description

An interface to asymmetric cipher keypair.

Synopsis

- class (Eq k, Typeable k, PKey k) => PublicKey k where
  - fromPublicKey :: k -> SomePublicKey
  - toPublicKey :: SomePublicKey -> Maybe k
- class PublicKey a => KeyPair a where
  - fromKeyPair :: a -> SomeKeyPair
  - toKeyPair :: SomeKeyPair -> Maybe a
- data SomePublicKey
- data SomeKeyPair

# Documentation

class (Eq k, Typeable k, PKey k) => PublicKey k where Source #

Instances of this class has at least public portion of a keypair. They might or might not have the private key.

Minimal complete definition

Nothing

Methods

fromPublicKey :: k -> SomePublicKey Source #

Wrap an arbitrary public key into polymorphic type `SomePublicKey`.

toPublicKey :: SomePublicKey -> Maybe k Source #

Cast from the polymorphic type `SomePublicKey` to the concrete type. Return `Nothing` if failed.

#### Instances

Instances details

PublicKey DSAKeyPair Source # |
Instance details Defined in OpenSSL.EVP.PKey Methods fromPublicKey :: DSAKeyPair -> SomePublicKey Source # toPublicKey :: SomePublicKey -> Maybe DSAKeyPair Source #
PublicKey DSAPubKey Source # |
Instance details Defined in OpenSSL.EVP.PKey Methods fromPublicKey :: DSAPubKey -> SomePublicKey Source # toPublicKey :: SomePublicKey -> Maybe DSAPubKey Source #
PublicKey SomeKeyPair Source # |
Instance details Defined in OpenSSL.EVP.PKey Methods fromPublicKey :: SomeKeyPair -> SomePublicKey Source # toPublicKey :: SomePublicKey -> Maybe SomeKeyPair Source #
PublicKey SomePublicKey Source # |
Instance details Defined in OpenSSL.EVP.PKey Methods fromPublicKey :: SomePublicKey -> SomePublicKey Source # toPublicKey :: SomePublicKey -> Maybe SomePublicKey Source #
PublicKey RSAKeyPair Source # |
Instance details Defined in OpenSSL.EVP.PKey Methods fromPublicKey :: RSAKeyPair -> SomePublicKey Source # toPublicKey :: SomePublicKey -> Maybe RSAKeyPair Source #
PublicKey RSAPubKey Source # |
Instance details Defined in OpenSSL.EVP.PKey Methods fromPublicKey :: RSAPubKey -> SomePublicKey Source # toPublicKey :: SomePublicKey -> Maybe RSAPubKey Source #

class PublicKey a => KeyPair a where Source #

Instances of this class has both of public and private portions of a keypair.

Minimal complete definition

Nothing

Methods

fromKeyPair :: a -> SomeKeyPair Source #

Wrap an arbitrary keypair into polymorphic type `SomeKeyPair`.

toKeyPair :: SomeKeyPair -> Maybe a Source #

Cast from the polymorphic type `SomeKeyPair` to the concrete type. Return `Nothing` if failed.

#### Instances

Instances details

KeyPair DSAKeyPair Source # |
Instance details Defined in OpenSSL.EVP.PKey Methods fromKeyPair :: DSAKeyPair -> SomeKeyPair Source # toKeyPair :: SomeKeyPair -> Maybe DSAKeyPair Source #
KeyPair SomeKeyPair Source # |
Instance details Defined in OpenSSL.EVP.PKey Methods fromKeyPair :: SomeKeyPair -> SomeKeyPair Source # toKeyPair :: SomeKeyPair -> Maybe SomeKeyPair Source #
KeyPair RSAKeyPair Source # |
Instance details Defined in OpenSSL.EVP.PKey Methods fromKeyPair :: RSAKeyPair -> SomeKeyPair Source # toKeyPair :: SomeKeyPair -> Maybe RSAKeyPair Source #

data SomePublicKey Source #

This is an opaque type to hold an arbitrary public key in it. The actual key type can be safelly type-casted using `toPublicKey`.

#### Instances

Instances details

PKey SomePublicKey Source # |
Instance details Defined in OpenSSL.EVP.PKey Methods toPKey :: SomePublicKey -> IO VaguePKey Source # fromPKey :: VaguePKey -> IO (Maybe SomePublicKey) Source # pkeySize :: SomePublicKey -> Int Source # pkeyDefaultMD :: SomePublicKey -> IO Digest Source #
PublicKey SomePublicKey Source # |
Instance details Defined in OpenSSL.EVP.PKey Methods fromPublicKey :: SomePublicKey -> SomePublicKey Source # toPublicKey :: SomePublicKey -> Maybe SomePublicKey Source #
Eq SomePublicKey Source # |
Instance details Defined in OpenSSL.EVP.PKey Methods (==) :: SomePublicKey -> SomePublicKey -> Bool Source # (/=) :: SomePublicKey -> SomePublicKey -> Bool Source #

data SomeKeyPair Source #

This is an opaque type to hold an arbitrary keypair in it. The actual key type can be safelly type-casted using `toKeyPair`.

#### Instances

Instances details

PKey SomeKeyPair Source # |
Instance details Defined in OpenSSL.EVP.PKey Methods toPKey :: SomeKeyPair -> IO VaguePKey Source # fromPKey :: VaguePKey -> IO (Maybe SomeKeyPair) Source # pkeySize :: SomeKeyPair -> Int Source # pkeyDefaultMD :: SomeKeyPair -> IO Digest Source #
KeyPair SomeKeyPair Source # |
Instance details Defined in OpenSSL.EVP.PKey Methods fromKeyPair :: SomeKeyPair -> SomeKeyPair Source # toKeyPair :: SomeKeyPair -> Maybe SomeKeyPair Source #
PublicKey SomeKeyPair Source # |
Instance details Defined in OpenSSL.EVP.PKey Methods fromPublicKey :: SomeKeyPair -> SomePublicKey Source # toPublicKey :: SomePublicKey -> Maybe SomeKeyPair Source #
Eq SomeKeyPair Source # |
Instance details Defined in OpenSSL.EVP.PKey Methods (==) :: SomeKeyPair -> SomeKeyPair -> Bool Source # (/=) :: SomeKeyPair -> SomeKeyPair -> Bool Source #

# Orphan instances

PKey DSAKeyPair Source # |
Instance details Methods toPKey :: DSAKeyPair -> IO VaguePKey Source # fromPKey :: VaguePKey -> IO (Maybe DSAKeyPair) Source # pkeySize :: DSAKeyPair -> Int Source # pkeyDefaultMD :: DSAKeyPair -> IO Digest Source #
PKey DSAPubKey Source # |
Instance details Methods toPKey :: DSAPubKey -> IO VaguePKey Source # fromPKey :: VaguePKey -> IO (Maybe DSAPubKey) Source # pkeySize :: DSAPubKey -> Int Source # pkeyDefaultMD :: DSAPubKey -> IO Digest Source #
PKey RSAKeyPair Source # |
Instance details Methods toPKey :: RSAKeyPair -> IO VaguePKey Source # fromPKey :: VaguePKey -> IO (Maybe RSAKeyPair) Source # pkeySize :: RSAKeyPair -> Int Source # pkeyDefaultMD :: RSAKeyPair -> IO Digest Source #
PKey RSAPubKey Source # |
Instance details Methods toPKey :: RSAPubKey -> IO VaguePKey Source # fromPKey :: VaguePKey -> IO (Maybe RSAPubKey) Source # pkeySize :: RSAPubKey -> Int Source # pkeyDefaultMD :: RSAPubKey -> IO Digest Source #