I have a VB-ActiveX used for encryption/validating password in a applicaton.
When used from ordinary client-programs/scripts it functions, not able to
obtain Context when running from web.
Any hints why this is happening would be appreciated.
' Parts of source is
' constant declaration
Private Const PROV_RSA_FULL As Long = 1
Private Const CRYPT_NEWKEYSET As Long = 8
Private Const CRYPT_MACHINE_KEYSET As Long = 32
Private Const SERVICE_PROVIDER As String = "Microsoft Base Cryptographic
Provider v1.0"
hCryptProv = 0
iErr = CryptAcquireContext(hCryptProv, sContainer & "1",
SERVICE_PROVIDER, PROV_RSA_FULL, CRYPT_NEWKEYSET)
If hCryptProv = 0 Then
iErr = CryptAcquireContext(hCryptProv, sContainer & "3",
SERVICE_PROVIDER, PROV_RSA_FULL, CRYPT_MACHINE_KEYSET)
If hCryptProv = 0 Then
iErr = CryptAcquireContext(hCryptProv, sContainer & "2",
SERVICE_PROVIDER, PROV_RSA_FULL, 0)
Err.Description = "ERROR:" & CStr(GetLastError) & vbCrLf & _
" - Container: " & sContainer & vbCrLf & _
" - Error during CryptAcquireContext for a new
key container." & vbCrLf & _
"A container with this name probably already
exists."
Err.Number = ERROR_APPLICATION_KEYS_NOT_FOUND + 1
Err.Raise Err.Number, "tfmutility.cryptoapi.InitCrypt",
Err.Description
End If
End If
>> Stay informed about: CryptAcquireContext - Fails from IIS/Asp-Vbscript