Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Encryption problems with xp
Message
De
06/02/2004 09:56:47
Jonathan Cochran
Alion Science and Technology
Maryland, États-Unis
 
 
À
05/02/2004 15:48:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00872528
Message ID:
00874817
Vues:
13
The provider you are using is the same one that we are using. I assume you have VFP 7 or 8, because I have VFP 6 and don't have the VCX you mention. You said that the code you posted is in the Init of the class? If so, then CryptAcquireContext is called before you manually specify the provider, which means that the provider name at that point is probably blank. Do you have the class on a form, or are you creating the class programmatically? If it is on a form, then try setting the provider name on the Properties sheet.

>Jonathan -
>
>Thanks for your thoughts on this one. I am mostly ignorant when it comes to the win api so please forgive me if that is obvious. I admit it up front. The init method of the class contains a call to the following code:
>
>LOCAL lhProviderHandle, lcProviderName, lcContainerName
>*** Create Handle to Crypto Provider
>
>
>If type('this.cProviderName') != T_CHARACTER then
> this.cProviderName = dcEmpty && Default
>EndIf
>lcProviderName = this.cProviderName
>If type('this.cContainerName') != T_CHARACTER then
> this.cContainerName = dcFOXPRO_APP && Default
>EndIf
>lcContainerName = this.cContainerName
>lhProviderHandle = 0
>
>if !this.CreateRandomCryptKeys(lcContainerName,lcProviderName,dnPROV_RSA_FULL)
> return .F.
>endif
>
>this.CryptAcquireContext(@lhProviderHandle, ;
>lcContainerName, lcProviderName, dnPROV_RSA_FULL,0)
>this.hProviderHandle = lhProviderHandle
>
>Return .T.
>
>dcEmpty appear to be .null. although I can't find where it is initialized. Nevertheless, it appears the third parameter is being passed as it should. That would seem to leave the problem with the later assignment:
>
>this.oCrypto.cProviderName = "Microsoft Base Cryptographic Provider v1.0"
>
>that is used in the actual implementation of the class. Could it be that there is a more specific provider name that should be referenced? If so how would I know what it should be?
>
>-btw The actual vcx file is the one that came with FoxPro and has not been changed. So, I would expect it to be right in it's code (as it seems to be).
>
>Thanks for any further thought on this.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform