hspkcs11-0.7: Wrapper for PKCS #11 interface

Safe HaskellNone
LanguageHaskell2010

Bindings.Pkcs11

Description

This module contains low-level binding for PKCS#11 C interface. Module is not intended to be used directly by user applications.

Synopsis

Documentation

type ObjectHandle = CULong Source #

Used to reference an object

type Rv = CULong Source #

data LibraryInfo Source #

Represents general library information. Returned by getInfo function.

Constructors

LibraryInfo 

Fields

data MechInfo Source #

Represent information about a mechanism. Returned by getMechanismInfo function.

Constructors

MechInfo 

Fields

data Mech Source #

Represents mechanism with parameters to be used in cryptographic operation. Parameterless mechanism can be created with simpleMech function. Few example operations using this data structure are encrypt, generateKey.

Constructors

Mech 

Instances

Storable Mech Source # 

Methods

sizeOf :: Mech -> Int #

alignment :: Mech -> Int #

peekElemOff :: Ptr Mech -> Int -> IO Mech #

pokeElemOff :: Ptr Mech -> Int -> Mech -> IO () #

peekByteOff :: Ptr b -> Int -> IO Mech #

pokeByteOff :: Ptr b -> Int -> Mech -> IO () #

peek :: Ptr Mech -> IO Mech #

poke :: Ptr Mech -> Mech -> IO () #

data SessionInfo Source #

Represent session information. Returned by getSessionInfo function.

Constructors

SessionInfo 

Fields

openSession' :: (Num b1, Num a3, Integral a2, Integral a1) => Ptr b2 -> a1 -> a2 -> IO (a3, b1) Source #

data AttributeType Source #

Constructors

ClassType 
TokenType 
PrivateType 
LabelType 
ApplicationType 
ValueType 
ObjectType 
CertificateType 
IssuerType 
SerialNumberType 
AcIssuerType 
OwnerType 
AttrTypesType 
TrustedType 
CertificateCategoryType 
JavaMidpSecurityDomainType 
UrlType 
HashOfSubjectPublicKeyType 
HashOfIssuerPublicKeyType 
CheckValueType 
KeyTypeType 
SubjectType 
IdType 
SensitiveType 
EncryptType 
DecryptType 
WrapType 
UnwrapType 
SignType 
SignRecoverType 
VerifyType 
VerifyRecoverType 
DeriveType 
StartDateType 
EndDataType 
ModulusType 
ModulusBitsType 
PublicExponentType 
PrivateExponentType 
Prime1Type 
Prime2Type 
Exponent1Type 
Exponent2Type 
CoefficientType 
PrimeType 
SubPrimeType 
BaseType 
PrimeBitsType 
SubPrimeBitsType 
ValueBitsType 
ValueLenType 
ExtractableType 
LocalType 
NeverExtractableType 
AlwaysSensitiveType 
KeyGenMechanismType 
ModifiableType 
EcdsaParamsType 
EcParamsType 
EcPointType 
SecondaryAuthType 
AuthPinFlagsType 
AlwaysAuthenticateType 
WrapWithTrustedType 
OtpFormatType 
OtpLengthType 
OtpTimeIntervalType 
OtpUserFriendlyModeType 
OtpChallengeRequirementType 
OtpTimeRequirementType 
OtpCounterRequirementType 
OtpPinRequirementType 
OtpUserIdentifierType 
OtpServiceIdentifierType 
OtpServiceLogoType 
OtpServiceLogoTypeType 
OtpCounterType 
OtpTimeType 
GostR3410ParamsType 
GostR3411ParamsType 
Gost28147ParamsType 
HwFeatureTypeType 
ResetOnInitType 
HasResetType 
PixelXType 
PixelYType 
ResolutionType 
CharRowsType 
CharColumnsType 
ColorType 
BitPerPixelType 
CharSetsType 
EncodingMethodsType 
MimeTypesType 
MechanismTypeType 
RequiredCmsAttributesType 
DefaultCmsAttributesType 
SupportedCmsAttributesType 
WrapTemplateType 
UnwrapTemplateType 
DeriveTemplateType 
AllowedMechanismsType 
VendorDefinedType 

data Attribute Source #

Represents an attribute of an object

Constructors

Class ClassType

class of an object, e.g. PrivateKey, SecretKey

KeyType KeyTypeValue

e.g. RSA or AES

Label String

object's label

Token Bool

whether object is stored on the token or is a temporary session object

Decrypt Bool

allow/deny encryption function for an object

Sign Bool

allow/deny signing function for an object

ModulusBits Int

number of bits used by modulus, for example in RSA public key

Modulus Integer

modulus value, used by RSA keys

PublicExponent Integer

value of public exponent, used by RSA public keys

PrimeBits Int

number of bits used by prime in classic Diffie-Hellman

Prime Integer

value of prime modulus, used in classic Diffie-Hellman

Base Integer

value of generator, used in classic Diffie-Hellman

ValueLen Int

length in bytes of the corresponding Value attribute

Value ByteString

object's value attribute, for example it is a DER encoded certificate for certificate objects

Extractable Bool

allows or denys extraction of certain attributes of private keys

EcParams ByteString

DER encoded ANSI X9.62 parameters value for elliptic-curve algorithm

EcdsaParams ByteString

DER encoded ANSI X9.62 parameters value for elliptic-curve algorithm

EcPoint ByteString

DER encoded ANSI X9.62 point for elliptic-curve algorithm

_pokeValues :: [Attribute] -> Ptr () -> IO () Source #

data MechType Source #

Constructors

RsaPkcsKeyPairGen 
RsaPkcs 
Rsa9796 
RsaX509 
Md2RsaPkcs 
Md5RsaPkcs 
Sha1RsaPkcs 
RipeMd128RsaPkcs 
RipeMd160RsaPkcs 
RsaPkcsOaep 
RsaX931KeyPairGen 
RsaX931 
Sha1RsaX931 
RsaPkcsPss 
Sha1RsaPkcsPss 
DsaKeyPairGen 
Dsa 
DsaSha1 
DhPkcsKeyPairGen 
DhPkcsDerive 
X942DhKeyPairGen 
X942DhDerive 
X942DhHybridDerive 
X942MqvDerive 
Sha256RsaPkcs 
Sha384RsaPkcs 
Sha512RsaPkcs 
Sha256RsaPkcsPss 
Sha384RsaPkcsPss 
Sha512RsaPkcsPss 
Sha224RsaPkcs 
Sha224RsaPkcsPss 
Rc2KeyGen 
Rc2Ecb 
Rc2Cbc 
Rc2Mac 
Rc2MacGeneral 
Rc2CbcPad 
Rc4KeyGen 
Rc4 
DesKeyGen 
DesEcb 
DesCbc 
DesMac 
DesMacGeneral 
DesCbcPad 
Des2KeyGen 
Des3KeyGen 
Des3Ecb 
Des3Cbc 
Des3Mac 
Des3MacGeneral 
Des3CbcPad 
CdmfKeyGen 
CdmfEcb 
CdmfCbc 
CdmfMac 
CdmfMacGeneral 
CdmfCbcPad 
DesOfb64 
DesOfb8 
DesCfb64 
DesCfb8 
Md2 
Md2Hmac 
Md2HmacGeneral 
Md5 
Md5Hmac 
Md5HmacGeneral 
Sha1 
Sha1Hmac 
Sha1HmacGeneral 
RipeMd128 
RipeMd128Hmac 
RipeMd128HmacGeneral 
Ripe160 
Ripe160Hmac 
Ripe160HmacGeneral 
Sha256 
Sha256Hmac 
Sha256HmacGeneral 
Sha224 
Sha224Hmac 
Sha224HmacGeneral 
Sha384 
Sha384Hmac 
Sha384HmacGeneral 
Sha512 
Sha512Hmac 
Sha512HmacGeneral 
CastKeyGen 
CastEcb 
CastCbc 
CastMac 
CastMacGeneral 
CastCbcPad 
Cast3KeyGen 
Cast3Ecb 
Cast3Cbc 
Cast3Mac 
Cast3MacGeneral 
Cast3CbcPad 
Cast5KeyGen 
Cast128KeyGen 
Cast5Ecb 
Cast128Ecb 
Cast5Cbc 
Cast128Cbc 
Cast5Mac 
Cast128Mac 
Cast5MacGeneral 
Cast128MacGeneral 
Cast5CbcPad 
Cast128CbcPad 
Rc5KeyGen 
Rc5Ecb 
Rc5Cbc 
Rc5Mac 
Rc5MacGeneral 
Rc5CbcPad 
IdeaKeyGen 
IdeaEcb 
IdeaCbc 
IdeaMac 
IdeaMacGeneral 
IdeaCbcPad 
GeneralSecretKeyGen 
ConcatenateBaseAndKey 
ConcatenateBaseAndData 
ConcatenateDataAndBase 
XorBaseAndData 
ExtractKeyFromKey 
Ssl3PreMasterKeyGen 
Ssl3MasterKeyDerive 
Ssl3KeyAndMacDerive 
Sha224KeyDerivation 
PbeMd2DesCbc 
PbeMd5DesCbc 
PbeMd5CastCbc 
PbeMd5Cast3Cbc 
PbeMd5Cast5Cbc 
PbeMd5Cast128Cbc 
PbeSha1Cast5Cbc 
PbeSha1Cast128Cbc 
PbeSha1Rc4128 
PbeSha1Rc440 
PbeSha1Des3EdeCbc 
PbeSha1Des2EdeCbc 
PbeSha1Rc2128Cbc 
PbeSha1Rc240Cbc 
Pkcs5Pbkd2 
PbaSha1WithSha1Hmac 
EcdsaKeyPairGen 
EcKeyPairGen 
Ecdsa 
EcdsaSha1 
Ecdh1Derive 
Ecdh1CofactorDerive 
DcmqvDerive 
JuniperKeyGen 
JuniperEcb128 
JuniperCbc128 
JuniperCounter 
JuniperShuffle 
JuniperWrap 
FastHash 
AesKeyGen 
AesEcb 
AesCbc 
AesMac 
AesMacGeneral 
AesCbcPad 
AesCtr 
AesGcm 
AesCcm 
AesKeyWrap 
BlowfishKeyGen 
AesKeyWrapPad 
BlowfishCbc 
TwoFishKeyGen 
TwoFishCbc 
DesEcbEncryptData 
DesCbcEncryptData 
Des3EcbEncryptData 
Des3CbcEncryptData 
AesEcbEncryptData 
AesCbcEncryptData 
DsaParameterGen 
DhPkcsParameterGen 
X9_42DhParameterGen 
VendorDefined 

initialize'_ :: FunPtr (Ptr () -> IO Rv) -> Ptr () -> IO Rv Source #

finalize'_ :: FunPtr (Ptr () -> IO Rv) -> Ptr () -> IO Rv Source #