Decoding MIME/SMIME Messages in Biztalk [closed] - encryption

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am developing a sample Encryption/Decryption solution in biztalk. for that purpose I created Test certificate by using Testcert utility. Then I successfully encrypted a message through MIME/SMIME encoder using test certificate. My problem is when I try to decrypt the previously encrypted file I get following error message:
There was a failure executing the receive pipeline: "EncryptionDecryption.ReceivePipeline1, EncryptionDecryption, Version=1.0.0.0, Culture=neutral, PublicKeyToken=de95fc107454e1ca" Source: "MIME/SMIME decoder" Receive Port: "ReceivePort4" URI: "C:\BIZTalkProjects\EncryptionDecryption\DecIN*.xml" Reason: There was an authentication failure. "Failed to decode the S/MIME message. The S/MIME message may not be valid.
What could be the reason? please help me. I am using biztalk server 2010.
Regards,
Shabbir

Did you check the procedures to write and read out the data? Decoding usually happens before the content is decrypted. Make sure that the file is complete and fully available in memory before the decrypt methods are called.

Related

No required "Session Timeout", [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
In my project session was only available for 30 minutes (Which is by default).
BUT... I want to disable this kind of session timeout. Means I required unlimited time for session by which my website never get log-in process again.
NEVER do this!
If user press X button on his browser his session (and all it's objects) will always be kept in server memory!
The solution is keeping ASP.NET Session alive using this simple javascript hack, not making extremely long sessions.
Javascript forces the page to post empty data to the server, it's a kind of ping.
Server doesn't post anything back but the session timeout is automatically resetted.
You can configure session time on 20 mins, and ping timer on 19 mins.
try this
maximum session timeout
<configuration>
<system.web>
<sessionState timeout="525600"></sessionState>
</system.web>
</configuration>
try that it increase timeout. if you want to store login info use cookies
<configuration>
<system.web>
<sessionState timeout="525600"></sessionState>
</system.web>
</configuration>

Get Website Name using asp.net [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
i want to get website name using asp.net
i have one website that website contain generic handler page. so my client's website send http request to my site. that time i want to validate whether the request come from my client website or any other site?. so how to find the website name?
I want to create api to send and receive http request. so thats way i need this coding.
Request Example:
http://MySite.com/GetRequest.ashx?mobile=9894380156&opt=RA&amt=10"
Response Example:
Recharge Accepted
Websites don't have a name property that you can pickup, but you can check various properties of the Request object and attempt to infer the origin of the request. For what I think you're trying to do you'd probably need to maintain a list of IP addresses/domains for your client sites and code some logic for this yourself.
Hope this helps.
I think what links between you and another website is the URL and you can use the information available in the new Uri("Your Site URL") and it can provide you with some valuable information about the url u are calling.

Encrypt your hard disk in C# [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
How to secure a hard disk programmatically through C#?
Like if a user wants to open a hard disk and first he/she has to give a password to access it. If the password is wrong then the hard disk is hidden from that user..
If you're trying to do this inside an app written in C#:
Get logical drives:
string[] drives = Directory.GetLogicalDrives();
Also check this out:
http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_23825199.html
http://bytes.com/topic/c-sharp/answers/276247-get-drive-letter-win32_diskdrive
You'll need to expand that more. Associate a drive letter with a password and keep that stored somewhere. If the entered password is correct, show that drive as you already have a list/array of them. (note it's too early for me to write this all out and I have a cold - but it's fairly simple).
You have your list of drives, you check a password to see if they can see a drive, if so let them see it.
If you are trying to restrict the entire windows system from showing drive letters based on a password, I would say do not use C#. This is a windows security issue.
I would recommend reading abot MS Group Policies. This article can help you:
http://support.microsoft.com/kb/231289
I don't think this can be done transparently (you can access the file with any program) and securely (that is, the disk is actually encrypted, not just hidden from the shell) in C# (on Windows, not on Singularity). To decrypt the disk on the fly you need a kernel mode driver. And you can't write that in .NET.
On Linux you might be able to write a FUSE (usermode) driver in C#+Mono.

How to restrict a user to enter data when a session expired in ASP.NET? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I have developed a ASP.NET application,I have used sessions for parameter passing.
I dont want to let the user to enter data when the session expired.Please suggest me how to do that.
Create a base page, inheriting from System.Web.UI.Page and in the on load event check your sesion object and if its null then redirect to the homepage and then have all your pages inheriting from that.
However as already commented on by others you database connection should not be left open anyway. Your UI shouldn't have any knowledge of your db connection. Your business layer is where you should be using your db connection.
In your business layer assuming your are using SQL you should have a statement something like:
using (SqlConnection con = new SqlConnection(connectionString))
{
}
At the end of the using statement your sql conection will be disposed. For more information, you might want to look at this article:
MSDN SqlConnection
Thanks
Paul

Connectionstring error after encrypted using aspnet_regiis.exe [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 9 years ago.
I've encrypted the connectionstring in my web.config file using the steps in the link below:
http://www.codeproject.com/KB/database/WebFarmConnStringsNet20.aspx
However, whenever I call my application, it will give the following error:
Failed to decrypt using provider
'CustomProvider'. Error message from
the provider: The RSA key container
could not be opened.
The server where I perform the encryption is a 64-bit Windows Server 2003 R2 SP2. Because of that I assign the ACL to NT Authority\Network Service. Yet it still doesn't work.
Hope someone has some ideas what else do I need to check to get this working.
PS. If I used the default rsa key NetFrameworkConfigurationKey for encryption, then the connection string will not have an access problem.
Well, I found the source of the problem, and boy was it embarrassing. In the attribute keyContainerName, I spelled the name incorrectly.
That it. That's what caused the problem.
Apparently, the encryption will work even if you provide an incorrect keyContainerName, which I incorrectly assumed will fail. So, once I decrypt the connectionstring and re-encrypt with the right keyContainerName, it works fine.
BTW, make sure to decrypt your existing connectionstring before correcting the keyContainerName. The aspnet_regiis.exe will complain about bad data, because the provider is now different.
Did you remember to add the
<configProtectedData>
to your web.config?

Resources