Safe Haskell | None |
---|---|
Language | Haskell98 |
Cryptographic Algorithms for Keys.
- class AsPublicKey k where
- data Crv
- data ECKeyParameters
- ecCrv :: Getter ECKeyParameters Crv
- ecX :: Getter ECKeyParameters SizedBase64Integer
- ecY :: Getter ECKeyParameters SizedBase64Integer
- ecD :: Getter ECKeyParameters (Maybe SizedBase64Integer)
- curve :: Crv -> Curve
- point :: ECKeyParameters -> Point
- ecPrivateKey :: (MonadError e m, AsError e) => ECKeyParameters -> m Integer
- data RSAPrivateKeyOthElem = RSAPrivateKeyOthElem {}
- data RSAPrivateKeyOptionalParameters = RSAPrivateKeyOptionalParameters {}
- data RSAPrivateKeyParameters = RSAPrivateKeyParameters {}
- data RSAKeyParameters = RSAKeyParameters Base64Integer Base64Integer (Maybe RSAPrivateKeyParameters)
- toRSAKeyParameters :: PrivateKey -> RSAKeyParameters
- rsaE :: Lens' RSAKeyParameters Base64Integer
- rsaN :: Lens' RSAKeyParameters Base64Integer
- rsaPrivateKeyParameters :: Lens' RSAKeyParameters (Maybe RSAPrivateKeyParameters)
- rsaPublicKey :: RSAKeyParameters -> PublicKey
- genRSA :: MonadRandom m => Int -> m RSAKeyParameters
- newtype OctKeyParameters = OctKeyParameters Base64Octets
- octK :: Iso' OctKeyParameters Base64Octets
- data OKPKeyParameters
- data OKPCrv
- data KeyMaterialGenParam
- data KeyMaterial
- genKeyMaterial :: MonadRandom m => KeyMaterialGenParam -> m KeyMaterial
- sign :: (MonadRandom m, MonadError e m, AsError e) => Alg -> KeyMaterial -> ByteString -> m ByteString
- verify :: (MonadError e m, AsError e) => Alg -> KeyMaterial -> ByteString -> ByteString -> m Bool
- module Crypto.Random
Type classes
class AsPublicKey k where Source #
Keys that may have have public material
asPublicKey :: Getter k (Maybe k) Source #
Get the public key
Parameters for Elliptic Curve Keys
"crv" (Curve) Parameter
data ECKeyParameters Source #
Parameters for Elliptic Curve Keys
point :: ECKeyParameters -> Point Source #
ecPrivateKey :: (MonadError e m, AsError e) => ECKeyParameters -> m Integer Source #
Parameters for RSA Keys
data RSAPrivateKeyOthElem Source #
"oth" (Other Primes Info) Parameter
data RSAPrivateKeyOptionalParameters Source #
Optional parameters for RSA private keys
data RSAKeyParameters Source #
Parameters for RSA Keys
genRSA :: MonadRandom m => Int -> m RSAKeyParameters Source #
Parameters for Symmetric Keys
newtype OctKeyParameters Source #
Symmetric key parameters data.
Parameters for CFRG EC keys (RFC 8037)
data OKPKeyParameters Source #
Key generation
data KeyMaterialGenParam Source #
Keygen parameters.
ECGenParam Crv | Generate an EC key with specified curve. |
RSAGenParam Int | Generate an RSA key with specified size in bytes. |
OctGenParam Int | Generate a symmetric key with specified size in bytes. |
OKPGenParam OKPCrv | Generate an EdDSA or Edwards ECDH key with specified curve. |
data KeyMaterial Source #
Key material sum type.
genKeyMaterial :: MonadRandom m => KeyMaterialGenParam -> m KeyMaterial Source #
Signing and verification
sign :: (MonadRandom m, MonadError e m, AsError e) => Alg -> KeyMaterial -> ByteString -> m ByteString Source #
verify :: (MonadError e m, AsError e) => Alg -> KeyMaterial -> ByteString -> ByteString -> m Bool Source #
module Crypto.Random