저는 C#을 처음 사용합니다. 왜 문제가 발생하는지 이해할 수 없었습니다.CryptographicException : 키가 지정된 상태에서 사용하기에 유효하지 않습니다.
CspParameters cspParams = new CspParameters(24);
cspParams.KeyContainerName = "XML_DISG_RSA_KEY";
RSACryptoServiceProvider key = new RSACryptoServiceProvider(cspParams);
아래의 코드는 내 로컬 설정에서 올바르게 작동합니다. 하지만 클라이언트에서 작동하지 않습니다.
그들은 예외입니다.
[CryptographicException : 키가 지정된 상태에서 사용하기에 유효하지 않습니다. ]
System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer) +4644432
System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle) +69
System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair() +92
System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32 dwKeySize, CspParameters parameters, Boolean useDefaultKeySize) +173
System.Security.Cryptography.RSACryptoServiceProvider..ctor(CspParameters parameters) +14
도와 주시겠습니까?