Workflow Soluiton

 View Only
  • 1.  'The system cannot find the file specified' using DecryptStringAsymetricalComponent

    Posted Sep 01, 2011 08:51 AM

    I'm getting the following error when attempting to decrypt a string using the DecryptStringAsymetricalComponent in Workflow 7.0 SP3:

    Component Name: DecryptStringAsymetricalComponent

    Exception Message: The system cannot find the file specified.

    Error Stack Trace:

    System.Security.Cryptography.CryptographicException: The system cannot find the file specified. at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer) at System.Security.Cryptography.RSACryptoServiceProvider.ImportParameters(RSAParameters parameters) at System.Security.Cryptography.RSA.FromXmlString(String xmlString) at LogicBase.Framework.EncryptionHelper.DecryptByteArray(Byte[] publickey, Byte[] privateKey, Byte[] value, AsymetricalCryptographyTypes type) in c:\build\projects\WF7RC1B\core\LogicBase.Framework\utilities\EncryptionHelper.cs:line 241 at LogicBase.Framework.EncryptionHelper.DecryptString(Byte[] publickey, Byte[] privateKey, Byte[] value, AsymetricalCryptographyTypes type) in c:\build\projects\WF7RC1B\core\LogicBase.Framework\utilities\EncryptionHelper.cs:line 150 at LogicBase.Components.Encryption.DecryptStringAsymetricalComponent.Run(IData data) in c:\build\projects\WF7RC1B\components\LogicBase.Components.Encryption\EncryptionSource.cs:line 1006 at LogicBase.Core.ExecutionEngine.MultiPathProcessComponentExecutionDelegate.Execute(IData data, IOrchestrationComponent comp, String& outputPath, IExecutionEngine engine, TLExecutionContext context) in c:\build\projects\WF7RC1B\core\LogicBase.Core\ExecutionEngine\ExecutionEngineDelegates.cs:line 280 at LogicBase.Core.ExecutionEngine.AbstractExecutionEngine.DoRunComp(IOrchestrationComponent comp, IData data, TLExecutionContext context) in c:\build\projects\WF7RC1B\core\LogicBase.Core\ExecutionEngine\ExecutionEngineImplementation.cs:line 465

     I have two separate projects. One uses the EncryptStringAsymetricalComponent to encrypt four strings of Type RSA. The other project uses the DecryptStringAsymetricalComponent to decrypt those strings and return the values for password reset challenge questions/answers. The decrypt component works fine using the debugger on my local machine with the Internal Web Server Workflow uses but once I debug in IIS or publish to IIS, it returns the errors. I've tried it in IIS with both Identity Impersonation and using an AppPool that uses the Identity of my service account, but both fail. Windows Integrated Authentication is turned on and Anonymous is not an option.

    If anyone has successfully worked with these components before, could you please share what is needed for the Decrypt component to work?

    Thanks!



  • 2.  RE: 'The system cannot find the file specified' using DecryptStringAsymetricalComponent

    Posted Sep 03, 2011 12:36 AM

    sounds like the error is based not on the authentication method but rather the location of the data source (to be decrypted).  usually if you get file location errors from published projects, but find that the project works in debug mode, you have a static path set someplace like "C:\Folder\File.ext" instead of what you should have, "\\servername\C$\Folder\File.ext".  this is what i've found, anyway.

    check any filepaths you may have set and determine if that could be the issue.  good luck, i hope that helps.



  • 3.  RE: 'The system cannot find the file specified' using DecryptStringAsymetricalComponent

    Posted Sep 03, 2011 11:02 AM

    Thanks for the reply but I don't have any file paths in my project at all. I'm pulling the encrypted data straight from SQL into the project. If I put a breakpoint on the decrypt component while I debug in IIS (happens while debugging in IIS - not just when published), I can see the variable that holds the encrypted data has valid values in it.



  • 4.  RE: 'The system cannot find the file specified' using DecryptStringAsymetricalComponent

    Posted Sep 05, 2011 03:20 AM

    According to stack trace such exception is thrown when the attempt to get the certificate from a keystore takes place and the account used by IIS pool does not have an proper rigthts for that operation.

    In some situations problem can be fixed by setting "Load User Profile" parameter to true in pool configuration allowing the account for partial loading of user profile and some other operation like temporary file creation in user's specific folders.



  • 5.  RE: 'The system cannot find the file specified' using DecryptStringAsymetricalComponent

    Posted Sep 12, 2011 11:13 AM

    Thanks for the reply AnaMan. I couldn't find where to set the "Load User Profile" parameter. Is that parameter only available in IIS 7.0? My WF server is Windows Server 2003/IIS 6.0. Thanks



  • 6.  RE: 'The system cannot find the file specified' using DecryptStringAsymetricalComponent

    Posted Sep 13, 2011 04:40 AM

    "Load User Profile" parameter is connected with specific security feature from IIS7 called Application Pool Identities. It is not available on IIS 6.0 server.

    http://learn.iis.net/page.aspx/624/application-pool-identities/



  • 7.  RE: 'The system cannot find the file specified' using DecryptStringAsymetricalComponent
    Best Answer

    Posted Sep 14, 2011 01:26 PM

    I "resolved" this by using a workaround of letting the decrypt project run under the DefaultAppPool (NetworkService account) and adding a WebService component to call a new, separate project that runs a Code snippet using the service account AppPool to do the password reset.