| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
OpenSSL.RSA
Description
An interface to RSA public key generator.
Synopsis
- class RSAKey k where
- data RSAPubKey
- data RSAKeyPair
- type RSAGenKeyCallback = Int -> Int -> IO ()
- generateRSAKey :: Int -> Int -> Maybe RSAGenKeyCallback -> IO RSAKeyPair
- generateRSAKey' :: Int -> Int -> IO RSAKeyPair
- rsaD :: RSAKeyPair -> Integer
- rsaP :: RSAKeyPair -> Integer
- rsaQ :: RSAKeyPair -> Integer
- rsaDMP1 :: RSAKeyPair -> Maybe Integer
- rsaDMQ1 :: RSAKeyPair -> Maybe Integer
- rsaIQMP :: RSAKeyPair -> Maybe Integer
- rsaCopyPublic :: RSAKey key => key -> IO RSAPubKey
Type
is either RSAKey aRSAPubKey or RSAKeyPair.
Minimal complete definition
Methods
returns the length of key.rsaSize key
returns the public modulus of the key.rsaN key
returns the public exponent of the key.rsaE key
withRSAPtr :: k -> (Ptr RSA -> IO a) -> IO a Source #
Instances
| RSAKey RSAKeyPair Source # | |
Defined in OpenSSL.RSA Methods rsaSize :: RSAKeyPair -> Int Source # rsaN :: RSAKeyPair -> Integer Source # rsaE :: RSAKeyPair -> Integer Source # withRSAPtr :: RSAKeyPair -> (Ptr RSA -> IO a) -> IO a Source # peekRSAPtr :: Ptr RSA -> IO (Maybe RSAKeyPair) Source # absorbRSAPtr :: Ptr RSA -> IO (Maybe RSAKeyPair) Source # | |
| RSAKey RSAPubKey Source # | |
Defined in OpenSSL.RSA | |
is an opaque object that represents RSA public key.RSAPubKey
Instances
| Eq RSAPubKey Source # | |
| Ord RSAPubKey Source # | |
| Show RSAPubKey Source # | |
| PKey RSAPubKey Source # | |
| RSAKey RSAPubKey Source # | |
Defined in OpenSSL.RSA | |
| PublicKey RSAPubKey Source # | |
Defined in OpenSSL.EVP.PKey Methods | |
data RSAKeyPair Source #
is an opaque object that represents RSA keypair.RSAKeyPair
Instances
Generating keypair
type RSAGenKeyCallback = Int -> Int -> IO () Source #
represents a callback function to get
informed the progress of RSA key generation.RSAGenKeyCallback
callback 0 iis called after generating thei-th potential prime number.- While the number is being tested for primality,
callback 1 jis called after thej-th iteration (j = 0, 1, ...). - When the
n-th randomly generated prime is rejected as not suitable for the key,callback 2 nis called. - When a random
phas been found withp-1 relatively prime toe, it is called ascallback 3 0. - The process is then repeated for prime
qwithcallback 3 1.
Arguments
| :: Int | The number of bits of the public modulus
(i.e. key size). Key sizes with |
| -> Int | The public exponent. It is an odd number, typically 3, 17 or 65537. |
| -> Maybe RSAGenKeyCallback | A callback function. |
| -> IO RSAKeyPair | The generated keypair. |
generates an RSA keypair.generateRSAKey
Arguments
| :: Int | The number of bits of the public modulus
(i.e. key size). Key sizes with |
| -> Int | The public exponent. It is an odd number, typically 3, 17 or 65537. |
| -> IO RSAKeyPair | The generated keypair. |
A simplified alternative to generateRSAKey