C# .NET - Digital Signature Private Key
Asked By Meetu Choudhary
12-May-09 01:43 AM
I am createing an asp.net web application in which i want to use(i want to use a digital signature certificate which is already issued to the User with my application for every registerd user) a digitalsignature to the user and using that digital signature the user can encrypt and decypt the files and data and mail using combination of private key and public key
the user will logon using this dsc in the application and using this dsc user can save his data in encypted format in the the he can ecrpt a file and save on server he can send encrypted email msgs and can decypt the data using same dsc from the database or decypt the file using same dsc
here DSC means Digital Signature Certificate
My Basic Question is How can i Ge the Private Key Of Digital Signature?
Please Help...
Ravenet Rasaiyah replied to Meetu Choudhary
Hi
To this you need use the Asymmetric algoritham with Crytography.
To get basic idea about secure your application data see here
http://msdn.microsoft.com/en-us/library/aa302378.aspx
to make digital signature with .net public and private key
http://www.codeproject.com/KB/vb/Digital_Signatures.aspx
http://www.c-sharpcorner.com/UploadFile/Gowri%20S%20Paramasivam/Cryptography211242005003308AM/Cryptography2.aspx
tnx
Thanks for reply but
Thanks for the reply...
but i need not to create the Digital Signature i do have signatures issued by the issuing authority i just need to get the private key of that signature can you please help me with some code samples...
Thanks and Regards,
Meetu Choudhary
Santhosh N replied to Meetu Choudhary
Check this one explaining basic premise public-key cryptography and how it relates to XML Digital Signatures, detail the creation of a key pair, give examples for signing and verifying an XML document, and discuss different implementations to provide reliable application licensing...
http://www.codeproject.com/KB/security/xmldsiglic.aspx
For your exact problem of using Private key you can check here for some inputs...
http://dotnetslackers.com/articles/security/Hashing_MACs_and_Digital_Signatures_in_NET.aspx
http://www.eggheadcafe.com/conversation.aspx?messageid=29236387&threadid=29236365
re

I have already gone through these links
let me clarify my problem once again
I am developing a web application in asp.net 3.5 framework with C# and in that application i have a rich textbox or multi line text box which contains data of n length and i want to encrypt and decrypt the data using the digital signatures
please consider that the user using the web application is already having the digital signatures from a Gov. recognized body and my application will not create any Digital Signature it will only use the .pfx file or the installed signature I am able to open the certificate store and it is displaying all the certificates installed on the computer.
now what i need is i want to encrypt the data using the digital signature's public key and decrypt it using the private key of the same digital signature. I may save the public key in the DB for encryption but to decrypt the data we need the digital signature.
please Help me its really very urgent.
Thanks and Regards
Meetu Choudhary
check these...
this might help you in this regard...
http://www.4guysfromrolla.com/articles/022807-1.aspx
http://www.codeproject.com/KB/cpp/RsaSignatureAppendix.aspx
re
Sir Thanks for your time devotion but
Please Understand i want to use digital signatures issued by 3rd party
here : http://www.codeproject.com/KB/cpp/RsaSignatureAppendix.aspx
it is encrypting and decrypting the file.
and here
http://www.4guysfromrolla.com/articles/022807-1.aspx
it has used SQL server
Matteo Slaviero replied to Meetu Choudhary
Hi,
try to see http://www.simple-talk.com/dotnet/.net-framework/beginning-with-digital-signatures-in-.net-framework/
or http://www.we-coffee.com/bonnie/bonnieWeb.aspx if you need to perform digital signature from an ASN.NET web page.

Create SQL Server DataBase Programmatically Hi! I want to create the SQL Server DataBase through Programmatically with SQL Script file using ASP.Net 2005.Can anyone explain with example source , it will be more appreciated. Thanks Steps to Create a SQL Server Database loadTOCNode(2, 'summary'); To create the database, follow these steps: 1. Create a new Visual C# .NET Windows application. 2. Place a the button's Name property to btnCreateDatabase , and then change the Text property to Create Database . 3. Use the using statement on the System and System.Data namespaces so that you System; using System.Data.SqlClient; 4. Switch to Form view, and then double-click Create Database to add the click event handler. Add the following sample code to the handler: String str; SqlConnection myConn = new SqlConnection ("Server = localhost;Integrated security = SSPI;database = master"); str = "CREATE DATABASE MyDatabase ON PRIMARY " + "(NAME = MyDatabase_Data, " + "FILENAME = 'C: \ MyDatabaseData.mdf', " + "SIZE = 2MB, MAXSIZE = 10MB, FILEGROWTH = 10%
reply Thanks in advance Sherya We will do our best!!! Sujit. I am using this Database, CREATE TABLE [dbo].[EmployeeProfile]( [EmpID] [int] NOT NULL, [EmpName] [varchar](50) NULL, [MySiteURL] [nvarchar](50 50) NULL, [E-Mail] [nvarchar](50) NULL, [Resume] [binary](50) NOT NULL, CONSTRAINT [PK_ _EmployeeProfile_ _014935CB] PRIMARY KEY CLUSTERED ( [EmpID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON nchar](10) NULL, [Duration] [int] NULL, [Efficiency] [nchar](10) NULL, [Status_code] [int] NOT NULL, PRIMARY KEY CLUSTERED ( [EmpID] ASC, [TechID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO ALTER TABLE [dbo].[EmpTechExp] WITH CHECK ADD FOREIGN KEY([TechID]) REFERENCES [dbo].[TechnologyMaster] ([TechID]) GO ALTER TABLE [dbo].[EmpTechExp] WITH CHECK ADD CONSTRAINT [FK_EMPID] FOREIGN KEY([EmpID]) REFERENCES [dbo].[EmployeeProfile] ([EmpID]) GO ALTER TABLE [dbo].[EmpTechExp] CHECK CONSTRAINT [FK_EMPID] GO ALTER TABLE [dbo].[EmpTechExp] WITH CHECK ADD CONSTRAINT [FK_Status_code] FOREIGN KEY([Status_code
objects programmatically. Caching of data can dramatically improve the performance of an application by reducing database contention and round-trips. Simply data caching store the required data in cache so that web server did not send request to DB server every time for each and every request which increase the web site performance. For which is accessible to all or which is very common data. cache["States"] = dsStates; Also check this link for more reply's http: / / www.eggheadcafe.com / community / aspnet / 17 / 10289504 / caching like Purchase ordering, Voucher creation etc. Now in a normal scenario the process of querying database for each request is not cost-effective in terms of server resources, hence is lot there is a single cached page available for this duration specified. * VaryByParam can take various "key" parameter names in query string. Also there are other attributes like VaryByHeader, VaryByCustom etc. Please and the cache declaration. <%@ Control Language = "C#"%> <%@ outputcache duration = "60" varybycontrol = "DepartMentId" %> < script runat = "server"> private int _Departmentid = 0; public int DepartMentId { get { return _Departmentid;} set {_Departmentid = value ;} } / / Load event of can create a cache and associate with it a dependency that is either another cache key or a file. In almost all Web applications there could be numerous master tables that makes sense for us to use them in our Cache rather than making calls to database on each request. But then what Cache Policy do we adopt? We cannot hold these
class Let see these with real example. . . . . . . . . . . the protected access modifier acts like both the private and public access modifiers. Like private , it only allows access to members within the same type, except that it acts like applying penalties for early withdrawal, and doing the work to remove the account from the database. Individually, you don't want any code to call methods of the BankAccount class unless For example, what if some code called the method to delete the account from the database and didn't calculate interest or apply penalties? Someone would loose money. Also, if the BankAccountProtected class to operate on its own members, you could have made the protected methods private instead. However, this code supports a framework where you can have different account types such Final Interest" ); } protected override void DeleteAccountFromDB() { base .DeleteAccountFromDB(); Console .WriteLine( "Savings Account Deleting Account from DB" ); } } Notice how SavingsAccount derives from BankAccountProtected . SavingsAccount can access any of the protected members of Final Interest" ); } protected override void DeleteAccountFromDB() { base .DeleteAccountFromDB(); Console .WriteLine( "Checking Account Deleting Account from DB" ); } } The CheckingAccount class in Listing 19-5 is implemented similar to SavingsAccount from Listing 19 internal Access Modifiers In practice, most of the code you write will involve the public , private , and protected access modifiers. However, there are two more access modifiers that you can use