module Botan.Low.PubKey.RSA (
privKeyLoadRSA
, privKeyLoadRSA_PKCS1
, privKeyRSAGetPrivKey
, pubKeyLoadRSA
) where
import Botan.Bindings.PubKey.RSA
import Botan.Low.MPI
import Botan.Low.PubKey
import Botan.Low.Remake
import Data.ByteString (ByteString)
import Data.Word
privKeyLoadRSA
:: MP
-> MP
-> MP
-> IO PrivKey
privKeyLoadRSA :: MP -> MP -> MP -> IO PrivKey
privKeyLoadRSA = (Ptr BotanPrivKey -> BotanMP -> BotanMP -> BotanMP -> IO CInt)
-> MP -> MP -> MP -> IO PrivKey
mkPrivKeyLoad3 Ptr BotanPrivKey -> BotanMP -> BotanMP -> BotanMP -> IO CInt
botan_privkey_load_rsa
privKeyLoadRSA_PKCS1
:: ByteString
-> IO PrivKey
privKeyLoadRSA_PKCS1 :: ByteString -> IO PrivKey
privKeyLoadRSA_PKCS1 = ((Ptr BotanPrivKey -> IO CInt) -> IO PrivKey)
-> (Ptr BotanPrivKey -> ConstPtr Word8 -> CSize -> IO CInt)
-> ByteString
-> IO PrivKey
forall botan object.
((Ptr botan -> IO CInt) -> IO object)
-> (Ptr botan -> ConstPtr Word8 -> CSize -> IO CInt)
-> ByteString
-> IO object
mkCreateObjectCBytesLen (Ptr BotanPrivKey -> IO CInt) -> IO PrivKey
createPrivKey Ptr BotanPrivKey -> ConstPtr Word8 -> CSize -> IO CInt
botan_privkey_load_rsa_pkcs1
privKeyRSAGetPrivKey
:: PrivKey
-> Word32
-> IO ByteString
privKeyRSAGetPrivKey :: PrivKey -> Word32 -> IO ByteString
privKeyRSAGetPrivKey = (forall b. PrivKey -> (BotanPrivKey -> IO b) -> IO b)
-> (BotanPrivKey -> Word32 -> Ptr Word8 -> Ptr CSize -> IO CInt)
-> PrivKey
-> Word32
-> IO ByteString
forall object botan a.
(forall b. object -> (botan -> IO b) -> IO b)
-> (botan -> a -> Ptr Word8 -> Ptr CSize -> IO CInt)
-> object
-> a
-> IO ByteString
mkWithObjectGetterCBytesLen1 PrivKey -> (BotanPrivKey -> IO b) -> IO b
forall b. PrivKey -> (BotanPrivKey -> IO b) -> IO b
withPrivKey
((BotanPrivKey -> Word32 -> Ptr Word8 -> Ptr CSize -> IO CInt)
-> PrivKey -> Word32 -> IO ByteString)
-> (BotanPrivKey -> Word32 -> Ptr Word8 -> Ptr CSize -> IO CInt)
-> PrivKey
-> Word32
-> IO ByteString
forall a b. (a -> b) -> a -> b
$ \ BotanPrivKey
rsa_key Word32
flags Ptr Word8
out Ptr CSize
out_len -> BotanPrivKey -> Ptr Word8 -> Ptr CSize -> Word32 -> IO CInt
botan_privkey_rsa_get_privkey BotanPrivKey
rsa_key Ptr Word8
out Ptr CSize
out_len Word32
flags
pubKeyLoadRSA
:: MP
-> MP
-> IO PubKey
pubKeyLoadRSA :: MP -> MP -> IO PubKey
pubKeyLoadRSA = (Ptr BotanPubKey -> BotanMP -> BotanMP -> IO CInt)
-> MP -> MP -> IO PubKey
mkPubKeyLoad2 Ptr BotanPubKey -> BotanMP -> BotanMP -> IO CInt
botan_pubkey_load_rsa