Safe Haskell | None |
---|
OpenSSL.EVP.PKey
Description
An interface to asymmetric cipher keypair.
- class PKey k
- 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 PKey k
class (Eq k, Typeable k, PKey k) => PublicKey k where
Instances of this class has at least public portion of a keypair. They might or might not have the private key.
Methods
fromPublicKey :: k -> SomePublicKey
Wrap an arbitrary public key into polymorphic type
SomePublicKey
.
toPublicKey :: SomePublicKey -> Maybe k
Cast from the polymorphic type SomePublicKey
to the concrete
type. Return Nothing
if failed.
class PublicKey a => KeyPair a where
Instances of this class has both of public and private portions of a keypair.
Methods
fromKeyPair :: a -> SomeKeyPair
Wrap an arbitrary keypair into polymorphic type SomeKeyPair
.
toKeyPair :: SomeKeyPair -> Maybe a
Cast from the polymorphic type SomeKeyPair
to the concrete
type. Return Nothing
if failed.
Instances
data SomePublicKey
This is an opaque type to hold an arbitrary public key in it. The
actual key type can be safelly type-casted using toPublicKey
.
data SomeKeyPair
This is an opaque type to hold an arbitrary keypair in it. The
actual key type can be safelly type-casted using toKeyPair
.