Click here to Skip to main content
15,886,093 members
Home / Discussions / C#
   

C#

 
GeneralRe: DataContractSerializer objects conversion performace improvement Pin
impeham3-Mar-14 2:42
impeham3-Mar-14 2:42 
GeneralRe: DataContractSerializer objects conversion performace improvement Pin
Ravi Bhavnani3-Mar-14 2:46
professionalRavi Bhavnani3-Mar-14 2:46 
GeneralRe: DataContractSerializer objects conversion performace improvement Pin
impeham5-Mar-14 1:49
impeham5-Mar-14 1:49 
Questionhow to call web api passing multiple parameters in c# Pin
rincy sivan27-Feb-14 0:37
rincy sivan27-Feb-14 0:37 
QuestionRe: how to call web api passing multiple parameters in c# Pin
Richard MacCutchan27-Feb-14 1:31
mveRichard MacCutchan27-Feb-14 1:31 
AnswerRe: how to call web api passing multiple parameters in c# Pin
rincy sivan27-Feb-14 18:36
rincy sivan27-Feb-14 18:36 
GeneralRe: how to call web api passing multiple parameters in c# Pin
Richard MacCutchan27-Feb-14 22:03
mveRichard MacCutchan27-Feb-14 22:03 
QuestionCreate Rsa Signature Pin
upmnemam26-Feb-14 21:50
upmnemam26-Feb-14 21:50 
I have one function witch check signature.

public static bool CheckSignature(string key64, string sig64)
      {
          var key = Convert.FromBase64String(key64);
          var sig = Convert.FromBase64String(sig64);

          var rsa = new RSACryptoServiceProvider(new CspParameters
          {
              Flags = CspProviderFlags.UseMachineKeyStore
          });
          rsa.FromXmlString("<RSAKeyValue><Modulus>4IlzOY3Y9fXoh3Y5f06wBbtTg94Pt6vcfcd1KQ0FLm0S36aGJtTSb6pYKfyX7PqCUQ8wgL6xUJ5GRPEsu9 gyz8ZobwfZsGCsvu40CWoT9fcFBZPfXro1Vtlh/xl/yYHm+Gzqh0Bw76xtLHSfLfpVOrmZdwKmSFKMTvNXOFd0V18=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>");
          var def = new RSAPKCS1SignatureDeformatter();
          def.SetKey(rsa);
          def.SetHashAlgorithm("MD5");

          return def.VerifySignature(key, sig);

      }


Now i need to create signature for one of my keys.

public static byte[] CreateSignature(string key64)
 {
     var data = Convert.FromBase64String(key64);

     var rSaCryptoServiceProvider = new RSACryptoServiceProvider(new CspParameters
     {
        Flags = CspProviderFlags.UseMachineKeyStore
     });

     rSaCryptoServiceProvider.FromXmlString("<RSAKeyValue><Modulus>4IlzOY3Y9fXoh3Y5f06wBbtTg94Pt6vcfcd1KQ0FLm0S36aGJtTSb6pYKfyX7PqCUQ8wgL6xUJ5GRPEsu9 gyz8ZobwfZsGCsvu40CWoT9fcFBZPfXro1Vtlh/xl/yYHm+Gzqh0Bw76xtLHSfLfpVOrmZdwKmSFKMTvNXOFd0V18=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>");


     var RSAform = new RSAPKCS1SignatureFormatter();
     RSAform.SetKey(rSaCryptoServiceProvider);
     RSAform.SetHashAlgorithm("MD5");

     byte[] hashData = CalculateMD5Hash(data);

     return RSAform.CreateSignature(hashData);
 }


But im getting an exception "Keyset does not exist" on "RSAform.CreateSignature(hashData)" line.
Any suggestion?
Still amater

AnswerRe: Create Rsa Signature Pin
Hessam Jalali1-Mar-14 11:02
Hessam Jalali1-Mar-14 11:02 
QuestionSQL Server project Pin
Lifefor Rent26-Feb-14 19:36
Lifefor Rent26-Feb-14 19:36 
AnswerRe: SQL Server project Pin
OriginalGriff26-Feb-14 20:52
mveOriginalGriff26-Feb-14 20:52 
AnswerRe: SQL Server project Pin
ScottM127-Feb-14 20:53
ScottM127-Feb-14 20:53 
QuestionSystem.Argument Exception Pin
TheJudeDude26-Feb-14 10:26
TheJudeDude26-Feb-14 10:26 
AnswerRe: System.Argument Exception Pin
OriginalGriff26-Feb-14 10:36
mveOriginalGriff26-Feb-14 10:36 
GeneralRe: System.Argument Exception Pin
TheJudeDude26-Feb-14 10:46
TheJudeDude26-Feb-14 10:46 
GeneralRe: System.Argument Exception Pin
phil.o27-Feb-14 0:00
professionalphil.o27-Feb-14 0:00 
QuestionRe: System.Argument Exception Pin
Richard Deeming26-Feb-14 11:25
mveRichard Deeming26-Feb-14 11:25 
AnswerRe: System.Argument Exception Pin
TheJudeDude26-Feb-14 12:01
TheJudeDude26-Feb-14 12:01 
AnswerRe: System.Argument Exception Pin
Richard Andrew x6426-Feb-14 14:11
professionalRichard Andrew x6426-Feb-14 14:11 
GeneralRe: System.Argument Exception Pin
Richard Deeming27-Feb-14 1:28
mveRichard Deeming27-Feb-14 1:28 
AnswerRe: System.Argument Exception Pin
Bernhard Hiller26-Feb-14 21:13
Bernhard Hiller26-Feb-14 21:13 
QuestionMessage Closed Pin
26-Feb-14 10:11
jon15126-Feb-14 10:11 
AnswerMessage Removed PinPopular
26-Feb-14 10:18
mveOriginalGriff26-Feb-14 10:18 
GeneralMessage Removed Pin
26-Feb-14 10:34
jon15126-Feb-14 10:34 
GeneralMessage Removed Pin
26-Feb-14 11:21
mveOriginalGriff26-Feb-14 11:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.