Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Library
- loadLibrary :: String -> IO Library
- data Version
- versionMajor :: Version -> Int
- versionMinor :: Version -> Int
- data Info
- getInfo :: Library -> IO Info
- infoCryptokiVersion :: Info -> Version
- infoManufacturerId :: Info -> String
- infoFlags :: Info -> Int
- infoLibraryDescription :: Info -> String
- infoLibraryVersion :: Info -> Version
- type SlotId = Int
- getSlotList :: Library -> Bool -> Int -> IO [SlotId]
- data SlotInfo
- getSlotInfo :: Library -> SlotId -> IO SlotInfo
- slotInfoDescription :: SlotInfo -> String
- slotInfoManufacturerId :: SlotInfo -> String
- slotInfoFlags :: SlotInfo -> Int
- slotInfoHardwareVersion :: SlotInfo -> Version
- slotInfoFirmwareVersion :: SlotInfo -> Version
- data TokenInfo
- getTokenInfo :: Library -> SlotId -> IO TokenInfo
- tokenInfoLabel :: TokenInfo -> String
- tokenInfoManufacturerId :: TokenInfo -> String
- tokenInfoModel :: TokenInfo -> String
- tokenInfoSerialNumber :: TokenInfo -> String
- tokenInfoFlags :: TokenInfo -> Int
- data MechType
- data MechInfo
- getMechanismList :: Library -> SlotId -> Int -> IO [Int]
- getMechanismInfo :: Library -> SlotId -> MechType -> IO MechInfo
- mechInfoMinKeySize :: MechInfo -> Int
- mechInfoMaxKeySize :: MechInfo -> Int
- mechInfoFlags :: MechInfo -> Int
- data Session
- data UserType
- withSession :: Library -> SlotId -> Bool -> (Session -> IO a) -> IO a
- login :: Session -> UserType -> ByteString -> IO ()
- logout :: Session -> IO ()
- type ObjectHandle = CULong
- data Attribute
- data ClassType
- data KeyTypeValue
- findObjects :: Session -> [Attribute] -> IO [ObjectHandle]
- getModulus :: Session -> ObjectHandle -> IO Integer
- getPublicExponent :: Session -> ObjectHandle -> IO Integer
- getDecryptFlag :: Session -> ObjectHandle -> IO Bool
- generateKeyPair :: Session -> MechType -> [Attribute] -> [Attribute] -> IO (ObjectHandle, ObjectHandle)
- unwrapKey :: MechType -> Session -> ObjectHandle -> ByteString -> [Attribute] -> IO ObjectHandle
- decrypt :: MechType -> Session -> ObjectHandle -> ByteString -> IO ByteString
- encrypt :: MechType -> Session -> ObjectHandle -> ByteString -> IO ByteString
Library
Reading library information
versionMajor :: Version -> Int Source #
versionMinor :: Version -> Int Source #
infoCryptokiVersion :: Info -> Version Source #
infoManufacturerId :: Info -> String Source #
infoLibraryDescription :: Info -> String Source #
infoLibraryVersion :: Info -> Version Source #
Slots
Reading slot information
slotInfoDescription :: SlotInfo -> String Source #
slotInfoFlags :: SlotInfo -> Int Source #
Reading token information
tokenInfoLabel :: TokenInfo -> String Source #
tokenInfoModel :: TokenInfo -> String Source #
tokenInfoFlags :: TokenInfo -> Int Source #
Mechanisms
mechInfoMinKeySize :: MechInfo -> Int Source #
mechInfoMaxKeySize :: MechInfo -> Int Source #
mechInfoFlags :: MechInfo -> Int Source #
Session management
Object attributes
type ObjectHandle = CULong Source #
data KeyTypeValue Source #
Searching objects
findObjects :: Session -> [Attribute] -> IO [ObjectHandle] Source #
Reading object attributes
getModulus :: Session -> ObjectHandle -> IO Integer Source #
getPublicExponent :: Session -> ObjectHandle -> IO Integer Source #
getDecryptFlag :: Session -> ObjectHandle -> IO Bool Source #
Key generation
generateKeyPair :: Session -> MechType -> [Attribute] -> [Attribute] -> IO (ObjectHandle, ObjectHandle) Source #
Key wrapping/unwrapping
unwrapKey :: MechType -> Session -> ObjectHandle -> ByteString -> [Attribute] -> IO ObjectHandle Source #
Encryption/decryption
decrypt :: MechType -> Session -> ObjectHandle -> ByteString -> IO ByteString Source #
encrypt :: MechType -> Session -> ObjectHandle -> ByteString -> IO ByteString Source #