Safe Haskell | None |
---|---|
Language | Haskell2010 |
An interface to asymmetric cipher keypair.
- class (Eq k, Typeable k, PKey k) => PublicKey k where
- class PublicKey a => KeyPair a where
- 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.
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.
class PublicKey a => KeyPair a where Source #
Instances of this class has both of public and private portions of a keypair.
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.
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
.
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
.