secure-sockets-1.2.9: Secure point-to-point connectivity library

Safe HaskellNone




class Identity a whereSource

An identity, public or private.


identityName :: a -> StringSource

Return the description that was associated with the identity when it was created.

writeIdentity :: (Functor m, MonadIO m) => a -> m ByteStringSource

Serialize an identity to a ByteString for storage or transmission.

readIdentity :: (Functor m, MonadIO m) => ByteString -> m aSource

Read back an identity previously serialized with writeIdentity.

data PeerIdentity Source

The public identity of a peer. This kind of identity can be used to authenticate the remote ends of connections.

data LocalIdentity Source

A local identity. This kind of identity can be used to authenticate to remote ends of connections.

toPeerIdentity :: LocalIdentity -> PeerIdentitySource

Extract the public parts of a LocalIdentity into a PeerIdentity suitable for sharing with peers. The resulting PeerIdentity will allow them to verify your identity when you authenticate using the corresponding LocalIdentity.

newLocalIdentity :: MonadIO m => String -> Int -> m LocalIdentitySource

Generate a new LocalIdentity, giving it an identifying name and a validity period in days.

Note that this function may take quite a while to execute, as it is generating key material for the identity.