Or ALG_TYPE_ANY) Or ALG_SID_SSL3SHAMD5)Private Const HP_ALGID = &H1 'Алгоритм хеширования
Private Const HP_HASHVAL = &H2 'Значение хеша
Private Const HP_HASHSIZE = &H4 'Размер значения хеша
Private Const HP_HMAC_INFO = &H5 'Информация для 'формирования НМАС
'Определения флагов dwFlags для CryptAcquireContext
Private Const CRYPT_VERIFYCONTEXT = &HF0000000
Private Const CRYPT_NEWKEYSET = &H8
Private Const CRYPT_DELETEKEYSET = &H10
Private Const CRYPT_MACHINE_KEYSET = &H20
' Определения флагов dwFlags для CryptGenKey
Private Const CRYPT_EXPORTABLE = &H1
Private Const CRYPT_USER_PROTECTED = &H2
Private Const CRYPT_CREATE_SALT = &H4
Private Const CRYPT_UPDATE_KEY = &H8
Private Const CRYPT_NO_SALT = &H10
Private Const CRYPT_PREGEN = &H40
Private Const CRYPT_RECIPIENT = &H10
Private Const CRYPT_INITIATOR = &H40
Private Const CRYPT_ONLINE = &H80
Private Const CRYPT_SF = &H100
Private Const CRYPT_CREATE_IV = &H200
Private Const CRYPT_KEK = &H400
Private Const CRYPT_DATA_KEY = &H800
Private Const CRYPT_FAILED = 0
Private Const CRYPT_SUCCEED = -1
' Определения флагов dwFlags для CryptDeriveKey
Private Const CRYPT_SERVER = &H400
Private Const KEY_LENGTH_MASK = &HFFFF0000
' Определения флагов dwFlags для CryptSetProviderEx
' и CryptGetDefaultProvider
Private Const CRYPT_MACHINE_DEFAULT = &H1
Private Const CRYPT_USER_DEFAULT = &H2
Private Const CRYPT_DELETE_DEFAULT = &H4
' CryptSetProvParam
Private Const PROV_RSA_FULL = 1
Private Const PROV_RSA_SIG = 2
Private Const PROV_DSS = 3
Private Const PROV_FORTEZZA = 4
Private Const PROV_MS_EXCHANGE = 5
Private Const PROV_SSL = 6
Private Const PROV_RSA_SCHANNEL = 12
Private Const PROV_DSS_DH = 13
Private Const PROV_EC_ECDSA_SIG = 14
Private Const PROV_EC_ECNRA_SIG = 15
Private Const PROV_EC_ECDSA_FULL = 16
Private Const PROV_EC_ECNRA_FULL = 17
Private Const PROV_SPYRUS_LYNKS = 20
' Наименования провайдеров
Private Const MS_DEF_PROV = _
"Microsoft Base Cryptographic Provider v1.0"
Private Const MS_ENHANCED_PROV = _
"Microsoft Enhanced Cryptographic Provider v1.0"
Private Const MS_DEF_RSA_SIG_PROV = _
"Microsoft RSA Signature Cryptographic Provider"
Private Const MS_DEF_RSA_SCHANNEL_PROV = _
"Microsoft Base RSA SChannel Cryptographic Provider"
Private Const MS_ENHANCED_RSA_SCHANNEL_PROV = _
"Microsoft Enhanced RSA SChannel Cryptographic _ Provider"
Private Const MS_DEF_DSS_PROV = _
"Microsoft Base DSS Cryptographic Provider"
Private Const MS_DEF_DSS_DH_PROV = _
"Microsoft Base DSS and Diffie-Hellman Cryptographic _ Provider"
' Объявление функций WinCrypt API
Private Declare Function CryptAcquireContext Lib _ "advapi32.dll" _
Alias "CryptAcquireContextA" (phProv As Long, _
ByVal pszContainer As String, ByVal pszProvider As _ String, _
ByVal dwProvType As Long, ByVal dwFlags As Long) As _ Long
Private Declare Function CryptReleaseContext Lib _ "advapi32.dll" ( _
ByVal hProv As Long, ByVal dwFlags As Long) As Long
Private Declare Function CryptDeriveKey Lib _ "advapi32.dll" ( _
ByVal hProv As Long, ByVal Algid As Long, _
Date: 2015-12-17; view: 1185
|