473,792 Members | 2,796 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CryptoAPI cryptographic service provider (CSP) for this implementation could not be acquired.

I have an application installed on a web server. When forst intalled it worked fine. The administrator rebooted the server and then when accessing the app the folowing error appears:

CryptoAPI cryptographic service provider (CSP) for this implementation could not be acquired.
I am using DPAPI(Machine Store) to encrypt a connection string. The decryption code is as follows:

private string GetConnectionSt ring()
{
DataProtector dp = new DataProtector(D ataProtector.St ore.USE_MACHINE _STORE);

string appSettingValue = ConfigurationSe ttings.AppSetti ngs["connectionStri ng"];
byte[] dataToDecrypt = Convert.FromBas e64String(appSe ttingValue);
string connStr = Encoding.ASCII. GetString(dp.De crypt(dataToDec rypt,null));
string connectionStrin g = connStr;

return connectionStrin g;
}

Can anyone provide any help for this problem?

Thanks,

Dave
Nov 15 '05 #1
4 6462
Dave,

You need to show the code for the DataProtector class, as it is not part
of the framework, and I imagine that is where the problem is occuring.

However, since this is in ASP.NET, are you sure that the site is
configured correctly so that the user that the page is being processed under
(ASPNET local user by default), has access to the cryptographic APIs? I
believe you need some sort of rights for this.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Dave Bailey" <an*******@disc ussions.microso ft.com> wrote in message
news:4B******** *************** ***********@mic rosoft.com...
I have an application installed on a web server. When forst intalled it worked fine. The administrator rebooted the server and then when accessing
the app the folowing error appears:
CryptoAPI cryptographic service provider (CSP) for this implementation could not be acquired.

I am using DPAPI(Machine Store) to encrypt a connection string. The decryption code is as follows:
private string GetConnectionSt ring()
{
DataProtector dp = new DataProtector(D ataProtector.St ore.USE_MACHINE _STORE);
string appSettingValue = ConfigurationSe ttings.AppSetti ngs["connectionStri ng"]; byte[] dataToDecrypt = Convert.FromBas e64String(appSe ttingValue);
string connStr = Encoding.ASCII. GetString(dp.De crypt(dataToDec rypt,null));
string connectionStrin g = connStr;

return connectionStrin g;
}

Can anyone provide any help for this problem?

Thanks,

Dave

Nov 15 '05 #2
Here is the code for the DataProtector class. By the way, why would it work at first but when the server was rebooted it quit working and threw the error?

using System;
using System.Text;
using System.Runtime. InteropServices ;

namespace DataProtection
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class DataProtector
{
[DllImport("Cryp t32.dll", SetLastError=tr ue,
CharSet=System. Runtime.Interop Services.CharSe t.Auto)]
private static extern bool CryptProtectDat a(
ref DATA_BLOB pDataIn,
String szDataDescr,
ref DATA_BLOB pOptionalEntrop y,
IntPtr pvReserved,
ref CRYPTPROTECT_PR OMPTSTRUCT pPromptStruct,
int dwFlags,
ref DATA_BLOB pDataOut);
[DllImport("Cryp t32.dll", SetLastError=tr ue,
CharSet=System. Runtime.Interop Services.CharSe t.Auto)]
private static extern bool CryptUnprotectD ata(
ref DATA_BLOB pDataIn,
String szDataDescr,
ref DATA_BLOB pOptionalEntrop y,
IntPtr pvReserved,
ref CRYPTPROTECT_PR OMPTSTRUCT pPromptStruct,
int dwFlags,
ref DATA_BLOB pDataOut);
[DllImport("kern el32.dll",
CharSet=System. Runtime.Interop Services.CharSe t.Auto)]
private unsafe static extern int FormatMessage(i nt dwFlags,
ref IntPtr lpSource,
int dwMessageId,
int dwLanguageId,
ref String lpBuffer, int nSize,
IntPtr *Arguments);

[StructLayout(La youtKind.Sequen tial, CharSet=CharSet .Unicode)]
internal struct DATA_BLOB
{
public int cbData;
public IntPtr pbData;
}
[StructLayout(La youtKind.Sequen tial, CharSet=CharSet .Unicode)]
internal struct CRYPTPROTECT_PR OMPTSTRUCT
{
public int cbSize;
public int dwPromptFlags;
public IntPtr hwndApp;
public String szPrompt;
}
static private IntPtr NullPtr = ((IntPtr)((int) (0)));
private const int CRYPTPROTECT_UI _FORBIDDEN = 0x1;
private const int CRYPTPROTECT_LO CAL_MACHINE = 0x4;

public enum Store {USE_MACHINE_ST ORE = 1, USE_USER_STORE} ;

private Store store;
public DataProtector(S tore tempStore)
{
store = tempStore;
}

public byte[] Encrypt(byte[] plainText, byte[] optionalEntropy )
{
bool retVal = false;
DATA_BLOB plainTextBlob = new DATA_BLOB();
DATA_BLOB cipherTextBlob = new DATA_BLOB();
DATA_BLOB entropyBlob = new DATA_BLOB();
CRYPTPROTECT_PR OMPTSTRUCT prompt = new CRYPTPROTECT_PR OMPTSTRUCT();
InitPromptstruc t(ref prompt);
int dwFlags;
try
{
try
{
int bytesSize = plainText.Lengt h;
plainTextBlob.p bData = Marshal.AllocHG lobal(bytesSize );
if(IntPtr.Zero == plainTextBlob.p bData)
{
throw new Exception("Unab le to allocate plaintext buffer.");
}
plainTextBlob.c bData = bytesSize;
Marshal.Copy(pl ainText, 0, plainTextBlob.p bData, bytesSize);
}
catch(Exception ex)
{
throw new Exception("Exce ption marshalling data. " + ex.Message);
}
if(Store.USE_MA CHINE_STORE == store)
{//Using the machine store, should be providing entropy.
dwFlags = CRYPTPROTECT_LO CAL_MACHINE|CRY PTPROTECT_UI_FO RBIDDEN;
//Check to see if the entropy is null
if(null == optionalEntropy )
{//Allocate something
optionalEntropy = new byte[0];
}
try
{
int bytesSize = optionalEntropy .Length;
entropyBlob.pbD ata = Marshal.AllocHG lobal(optionalE ntropy.Length); ;
if(IntPtr.Zero == entropyBlob.pbD ata)
{
throw new Exception("Unab le to allocate entropy data buffer.");
}
Marshal.Copy(op tionalEntropy, 0, entropyBlob.pbD ata, bytesSize);
entropyBlob.cbD ata = bytesSize;
}
catch(Exception ex)
{
throw new Exception("Exce ption entropy marshalling data. " +
ex.Message);
}
}
else
{//Using the user store
dwFlags = CRYPTPROTECT_UI _FORBIDDEN;
}
retVal = CryptProtectDat a(ref plainTextBlob, "", ref entropyBlob,
IntPtr.Zero, ref prompt, dwFlags,
ref cipherTextBlob) ;
if(false == retVal)
{
throw new Exception("Encr yption failed. " +
GetErrorMessage (Marshal.GetLas tWin32Error())) ;
}
}
catch(Exception ex)
{
throw new Exception("Exce ption encrypting. " + ex.Message);
}
byte[] cipherText = new byte[cipherTextBlob. cbData];
Marshal.Copy(ci pherTextBlob.pb Data, cipherText, 0, cipherTextBlob. cbData);
return cipherText;
}

public byte[] Decrypt(byte[] cipherText, byte[] optionalEntropy )
{
bool retVal = false;
DATA_BLOB plainTextBlob = new DATA_BLOB();
DATA_BLOB cipherBlob = new DATA_BLOB();
CRYPTPROTECT_PR OMPTSTRUCT prompt = new CRYPTPROTECT_PR OMPTSTRUCT();
InitPromptstruc t(ref prompt);
try
{
try
{
int cipherTextSize = cipherText.Leng th;
cipherBlob.pbDa ta = Marshal.AllocHG lobal(cipherTex tSize);
if(IntPtr.Zero == cipherBlob.pbDa ta)
{
throw new Exception("Unab le to allocate cipherText buffer.");
}
cipherBlob.cbDa ta = cipherTextSize;
Marshal.Copy(ci pherText, 0, cipherBlob.pbDa ta, cipherBlob.cbDa ta);
}
catch(Exception ex)
{
throw new Exception("Exce ption marshalling data. " + ex.Message);
}
DATA_BLOB entropyBlob = new DATA_BLOB();
int dwFlags;
if(Store.USE_MA CHINE_STORE == store)
{//Using the machine store, should be providing entropy.
dwFlags = CRYPTPROTECT_LO CAL_MACHINE|CRY PTPROTECT_UI_FO RBIDDEN;
//Check to see if the entropy is null
if(null == optionalEntropy )
{//Allocate something
optionalEntropy = new byte[0];
}
try
{
int bytesSize = optionalEntropy .Length;
entropyBlob.pbD ata = Marshal.AllocHG lobal(bytesSize );
if(IntPtr.Zero == entropyBlob.pbD ata)
{
throw new Exception("Unab le to allocate entropy buffer.");
}
entropyBlob.cbD ata = bytesSize;
Marshal.Copy(op tionalEntropy, 0, entropyBlob.pbD ata, bytesSize);
}
catch(Exception ex)
{
throw new Exception("Exce ption entropy marshalling data. " +
ex.Message);
}
}
else
{//Using the user store
dwFlags = CRYPTPROTECT_UI _FORBIDDEN;
}
retVal = CryptUnprotectD ata(ref cipherBlob, null, ref entropyBlob,
IntPtr.Zero, ref prompt, dwFlags,
ref plainTextBlob);
if(false == retVal)
{
throw new Exception("Decr yption failed. " +
GetErrorMessage (Marshal.GetLas tWin32Error())) ;
}
//Free the blob and entropy.
if(IntPtr.Zero != cipherBlob.pbDa ta)
{
Marshal.FreeHGl obal(cipherBlob .pbData);
}
if(IntPtr.Zero != entropyBlob.pbD ata)
{
Marshal.FreeHGl obal(entropyBlo b.pbData);
}
}
catch(Exception ex)
{
throw new Exception("Exce ption decrypting. " + ex.Message);
}
byte[] plainText = new byte[plainTextBlob.c bData];
Marshal.Copy(pl ainTextBlob.pbD ata, plainText, 0, plainTextBlob.c bData);
return plainText;
}

private void InitPromptstruc t(ref CRYPTPROTECT_PR OMPTSTRUCT ps)
{
ps.cbSize = Marshal.SizeOf( typeof(CRYPTPRO TECT_PROMPTSTRU CT));
ps.dwPromptFlag s = 0;
ps.hwndApp = NullPtr;
ps.szPrompt = null;
}
private unsafe static String GetErrorMessage (int errorCode)
{
int FORMAT_MESSAGE_ ALLOCATE_BUFFER = 0x00000100;
int FORMAT_MESSAGE_ IGNORE_INSERTS = 0x00000200;
int FORMAT_MESSAGE_ FROM_SYSTEM = 0x00001000;
int messageSize = 255;
String lpMsgBuf = "";
int dwFlags = FORMAT_MESSAGE_ ALLOCATE_BUFFER | FORMAT_MESSAGE_ FROM_SYSTEM |
FORMAT_MESSAGE_ IGNORE_INSERTS;
IntPtr ptrlpSource = new IntPtr();
IntPtr prtArguments = new IntPtr();
int retVal = FormatMessage(d wFlags, ref ptrlpSource, errorCode, 0,
ref lpMsgBuf, messageSize, &prtArgument s);
if(0 == retVal)
{
throw new Exception("Fail ed to format message for error code " +
errorCode + ". ");
}
return lpMsgBuf;
}



}
}
Nov 15 '05 #3
Dave,

I was thinking that maybe you had it on a dev machine, and then moved it
to another machine, which needed to be rebooted (for some strange reason).

Rebooting the machine should not have an effect. In your code, which
line is it that is throwing the exception? Also, do you have a specific
error code? I can't tell looking through all of the code.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Dave Bailey" <an*******@disc ussions.microso ft.com> wrote in message
news:09******** *************** ***********@mic rosoft.com...
Here is the code for the DataProtector class. By the way, why would it work at first but when the server was rebooted it quit working and threw the
error?
using System;
using System.Text;
using System.Runtime. InteropServices ;

namespace DataProtection
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class DataProtector
{
[DllImport("Cryp t32.dll", SetLastError=tr ue,
CharSet=System. Runtime.Interop Services.CharSe t.Auto)]
private static extern bool CryptProtectDat a(
ref DATA_BLOB pDataIn,
String szDataDescr,
ref DATA_BLOB pOptionalEntrop y,
IntPtr pvReserved,
ref CRYPTPROTECT_PR OMPTSTRUCT pPromptStruct,
int dwFlags,
ref DATA_BLOB pDataOut);
[DllImport("Cryp t32.dll", SetLastError=tr ue,
CharSet=System. Runtime.Interop Services.CharSe t.Auto)]
private static extern bool CryptUnprotectD ata(
ref DATA_BLOB pDataIn,
String szDataDescr,
ref DATA_BLOB pOptionalEntrop y,
IntPtr pvReserved,
ref CRYPTPROTECT_PR OMPTSTRUCT pPromptStruct,
int dwFlags,
ref DATA_BLOB pDataOut);
[DllImport("kern el32.dll",
CharSet=System. Runtime.Interop Services.CharSe t.Auto)]
private unsafe static extern int FormatMessage(i nt dwFlags,
ref IntPtr lpSource,
int dwMessageId,
int dwLanguageId,
ref String lpBuffer, int nSize,
IntPtr *Arguments);

[StructLayout(La youtKind.Sequen tial, CharSet=CharSet .Unicode)]
internal struct DATA_BLOB
{
public int cbData;
public IntPtr pbData;
}
[StructLayout(La youtKind.Sequen tial, CharSet=CharSet .Unicode)]
internal struct CRYPTPROTECT_PR OMPTSTRUCT
{
public int cbSize;
public int dwPromptFlags;
public IntPtr hwndApp;
public String szPrompt;
}
static private IntPtr NullPtr = ((IntPtr)((int) (0)));
private const int CRYPTPROTECT_UI _FORBIDDEN = 0x1;
private const int CRYPTPROTECT_LO CAL_MACHINE = 0x4;

public enum Store {USE_MACHINE_ST ORE = 1, USE_USER_STORE} ;

private Store store;
public DataProtector(S tore tempStore)
{
store = tempStore;
}

public byte[] Encrypt(byte[] plainText, byte[] optionalEntropy )
{
bool retVal = false;
DATA_BLOB plainTextBlob = new DATA_BLOB();
DATA_BLOB cipherTextBlob = new DATA_BLOB();
DATA_BLOB entropyBlob = new DATA_BLOB();
CRYPTPROTECT_PR OMPTSTRUCT prompt = new CRYPTPROTECT_PR OMPTSTRUCT();
InitPromptstruc t(ref prompt);
int dwFlags;
try
{
try
{
int bytesSize = plainText.Lengt h;
plainTextBlob.p bData = Marshal.AllocHG lobal(bytesSize );
if(IntPtr.Zero == plainTextBlob.p bData)
{
throw new Exception("Unab le to allocate plaintext buffer.");
}
plainTextBlob.c bData = bytesSize;
Marshal.Copy(pl ainText, 0, plainTextBlob.p bData, bytesSize);
}
catch(Exception ex)
{
throw new Exception("Exce ption marshalling data. " + ex.Message);
}
if(Store.USE_MA CHINE_STORE == store)
{//Using the machine store, should be providing entropy.
dwFlags = CRYPTPROTECT_LO CAL_MACHINE|CRY PTPROTECT_UI_FO RBIDDEN;
//Check to see if the entropy is null
if(null == optionalEntropy )
{//Allocate something
optionalEntropy = new byte[0];
}
try
{
int bytesSize = optionalEntropy .Length;
entropyBlob.pbD ata = Marshal.AllocHG lobal(optionalE ntropy.Length); ;
if(IntPtr.Zero == entropyBlob.pbD ata)
{
throw new Exception("Unab le to allocate entropy data buffer.");
}
Marshal.Copy(op tionalEntropy, 0, entropyBlob.pbD ata, bytesSize);
entropyBlob.cbD ata = bytesSize;
}
catch(Exception ex)
{
throw new Exception("Exce ption entropy marshalling data. " +
ex.Message);
}
}
else
{//Using the user store
dwFlags = CRYPTPROTECT_UI _FORBIDDEN;
}
retVal = CryptProtectDat a(ref plainTextBlob, "", ref entropyBlob,
IntPtr.Zero, ref prompt, dwFlags,
ref cipherTextBlob) ;
if(false == retVal)
{
throw new Exception("Encr yption failed. " +
GetErrorMessage (Marshal.GetLas tWin32Error())) ;
}
}
catch(Exception ex)
{
throw new Exception("Exce ption encrypting. " + ex.Message);
}
byte[] cipherText = new byte[cipherTextBlob. cbData];
Marshal.Copy(ci pherTextBlob.pb Data, cipherText, 0, cipherTextBlob. cbData);
return cipherText;
}

public byte[] Decrypt(byte[] cipherText, byte[] optionalEntropy )
{
bool retVal = false;
DATA_BLOB plainTextBlob = new DATA_BLOB();
DATA_BLOB cipherBlob = new DATA_BLOB();
CRYPTPROTECT_PR OMPTSTRUCT prompt = new CRYPTPROTECT_PR OMPTSTRUCT();
InitPromptstruc t(ref prompt);
try
{
try
{
int cipherTextSize = cipherText.Leng th;
cipherBlob.pbDa ta = Marshal.AllocHG lobal(cipherTex tSize);
if(IntPtr.Zero == cipherBlob.pbDa ta)
{
throw new Exception("Unab le to allocate cipherText buffer.");
}
cipherBlob.cbDa ta = cipherTextSize;
Marshal.Copy(ci pherText, 0, cipherBlob.pbDa ta, cipherBlob.cbDa ta);
}
catch(Exception ex)
{
throw new Exception("Exce ption marshalling data. " + ex.Message);
}
DATA_BLOB entropyBlob = new DATA_BLOB();
int dwFlags;
if(Store.USE_MA CHINE_STORE == store)
{//Using the machine store, should be providing entropy.
dwFlags = CRYPTPROTECT_LO CAL_MACHINE|CRY PTPROTECT_UI_FO RBIDDEN;
//Check to see if the entropy is null
if(null == optionalEntropy )
{//Allocate something
optionalEntropy = new byte[0];
}
try
{
int bytesSize = optionalEntropy .Length;
entropyBlob.pbD ata = Marshal.AllocHG lobal(bytesSize );
if(IntPtr.Zero == entropyBlob.pbD ata)
{
throw new Exception("Unab le to allocate entropy buffer.");
}
entropyBlob.cbD ata = bytesSize;
Marshal.Copy(op tionalEntropy, 0, entropyBlob.pbD ata, bytesSize);
}
catch(Exception ex)
{
throw new Exception("Exce ption entropy marshalling data. " +
ex.Message);
}
}
else
{//Using the user store
dwFlags = CRYPTPROTECT_UI _FORBIDDEN;
}
retVal = CryptUnprotectD ata(ref cipherBlob, null, ref entropyBlob,
IntPtr.Zero, ref prompt, dwFlags,
ref plainTextBlob);
if(false == retVal)
{
throw new Exception("Decr yption failed. " +
GetErrorMessage (Marshal.GetLas tWin32Error())) ;
}
//Free the blob and entropy.
if(IntPtr.Zero != cipherBlob.pbDa ta)
{
Marshal.FreeHGl obal(cipherBlob .pbData);
}
if(IntPtr.Zero != entropyBlob.pbD ata)
{
Marshal.FreeHGl obal(entropyBlo b.pbData);
}
}
catch(Exception ex)
{
throw new Exception("Exce ption decrypting. " + ex.Message);
}
byte[] plainText = new byte[plainTextBlob.c bData];
Marshal.Copy(pl ainTextBlob.pbD ata, plainText, 0, plainTextBlob.c bData);
return plainText;
}

private void InitPromptstruc t(ref CRYPTPROTECT_PR OMPTSTRUCT ps)
{
ps.cbSize = Marshal.SizeOf( typeof(CRYPTPRO TECT_PROMPTSTRU CT));
ps.dwPromptFlag s = 0;
ps.hwndApp = NullPtr;
ps.szPrompt = null;
}
private unsafe static String GetErrorMessage (int errorCode)
{
int FORMAT_MESSAGE_ ALLOCATE_BUFFER = 0x00000100;
int FORMAT_MESSAGE_ IGNORE_INSERTS = 0x00000200;
int FORMAT_MESSAGE_ FROM_SYSTEM = 0x00001000;
int messageSize = 255;
String lpMsgBuf = "";
int dwFlags = FORMAT_MESSAGE_ ALLOCATE_BUFFER | FORMAT_MESSAGE_ FROM_SYSTEM | FORMAT_MESSAGE_ IGNORE_INSERTS;
IntPtr ptrlpSource = new IntPtr();
IntPtr prtArguments = new IntPtr();
int retVal = FormatMessage(d wFlags, ref ptrlpSource, errorCode, 0,
ref lpMsgBuf, messageSize, &prtArgument s);
if(0 == retVal)
{
throw new Exception("Fail ed to format message for error code " +
errorCode + ". ");
}
return lpMsgBuf;
}



}
}

Nov 15 '05 #4
Here is the entire error page.

CryptoAPI cryptographic service provider (CSP) for this implementation could not be acquired.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Security .Cryptography.C ryptographicExc eption: CryptoAPI cryptographic service provider (CSP) for this implementation could not be acquired

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[CryptographicEx ception: CryptoAPI cryptographic service provider (CSP) for this implementation could not be acquired.
System.Security .Cryptography.S HA1CryptoServic eProvider..ctor (CspParameters parameters) +39
System.Security .Cryptography.S HA1CryptoServic eProvider..ctor () +5

[TargetInvocatio nException: Exception has been thrown by the target of an invocation.
System.Reflecti on.RuntimeConst ructorInfo.Inte rnalInvoke(Bind ingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault ) +
System.Reflecti on.RuntimeConst ructorInfo.Invo ke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +49
System.Security .Cryptography.C ryptoConfig.Cre ateFromName(Str ing name, Object[] args) +41
System.Security .Cryptography.S HA1.Create(Stri ng hashName) +
System.Security .Cryptography.H MACSHA1..ctor(B yte[] rgbKey) +11
System.Web.Conf iguration.Exten dedHMACSHA1.Get HMACSHA1() +37
System.Web.Conf iguration.Machi neKey.HMACSHA1H ashForData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length) +1
System.Web.Conf iguration.Machi neKey.HashData( Byte[] buf, Byte[] modifier, Int32 start, Int32 length) +7
System.Web.Conf iguration.Machi neKey.GetEncode dData(Byte[] buf, Byte[] modifier, Int32 start, Int32& length) +6
System.Web.UI.L osWriter.Comple teTransforms(Te xtWriter output, Boolean enableMac, Byte[] macKey) +19
System.Web.UI.L osFormatter.Ser ializeInternal( TextWriter output, Object value) +12
System.Web.UI.P age.OnFormRende r(HtmlTextWrite r writer, String formUniqueID) +14
System.Web.UI.H tmlControls.Htm lForm.RenderChi ldren(HtmlTextW riter writer) +3
System.Web.UI.H tmlControls.Htm lForm.Render(Ht mlTextWriter output) +26
System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer) +24
System.Web.UI.C ontrol.RenderCh ildren(HtmlText Writer writer) +7
System.Web.UI.C ontrol.Render(H tmlTextWriter writer) +
System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer) +24
System.Web.UI.P age.ProcessRequ estMain() +192


Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2035
by: BuddyWork | last post by:
Hello, Basically because the key is installed in the CSP when compiling the code the first time. Then the next time I compile the code the strong name file is not required because it gets its from the CSP, but if I want to remove it from the CSP for security reasons, how do I do this. See the comments in the AssemblyInfo.cs that is added by Microsoft.
1
1902
by: Greg Merideth | last post by:
I've finally got my client/server secure soap process working and I've just noticed that under the servers \NetworkService\AppData\MS\Crypto\RSA folder there are some 100+ paired sets of RSA keys. I don't setup RSACryptoServiceProvider using CspParameters and I didn't give the RSA initiator any paramters when I setup the class yet, each implementation of the RSA class, as a web service, is creating a cryptoAPI storage bin for the RSA...
0
1083
by: Bonj | last post by:
Hi i have a question regarding the CryptoAPI. I can seemingly call CryptAcquireContext, and if I pass any random string as the key container name and NULL as the provider name, with CRYPT_NEWKEYSET as the last parameter, then the rest of the crypt functions seem to work. But I came across an instance when I stopped debugging the program, before I had called CryptReleaseContext, and when I ran the program again, I got FALSE returned, and...
0
1676
by: Andrés Giraldo | last post by:
Hi! I'm trying to use a System.Security.Criptography function, it works on my machine but when I publish the site, it gives me the following error: Can't find a cryptographic service provider (CSP) in this algorythm... Any Idea of what's wrong??? Thanks
4
6931
by: Sven-Torben Janus | last post by:
I'm running an ASP.NET webapplication on a Windows 2000 Server SP4 machine with .Net Framework 1.0 installed. The ASP.Net application uses impersonation (windows domain account). This is needed for communication between two servers (some ldap stuff). Furthermore the application uses FormsAuthentication. At some point the FomrAuthentication.Decrypt method is called. At this point I get the following error:
0
1197
by: Gabor | last post by:
Hi All, In my aspnet app. I'm using forms authentication. This site works on many intranet. On one place I got the crypto service provider error with the following stack trace, that I didn't get before elsewhere. In this site the op system is WinXP with sp2.
0
1355
by: Mike P | last post by:
This is a very weird problem, when I boot my IIS server I get a CryptoAPI cryptographic service provider (CSP) for this implementation could not be acquired exception. However, once I access my site within the server, the exception goes away. My ASP page only displays the logon user (only 2 lines of code). I don't understand this behavior at all.
6
1932
by: dotNeter | last post by:
The services, talked here, are things used in IServiceContainer, IServiceProvider, etc. In my opinion, everything can be a service, and a service is generally used for providing specific features for service consumers, at design time. But, I think the cnsumers must completely know all aspects of that service. This sounds not good, and breaks the decoupling rule. So how to understand the role of Service, in a software engineering...
17
6732
by: almurph | last post by:
Hi, Hope you can help me with this one. I am trying to create random number between 0 and 1 inclusive of cryptographiuc quality. The problems is though - I don't know how! Here is what I have so far and I would greatly appreciate any comments/suggestions/code-samples that you may like to share. Thank you. Al
0
9670
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10430
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10211
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2917
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.