public StratisBlockData CertifyUser(string emailAddress, string moocEmailAddress, MicroCredential MicroCredential) { var block = new StratisBlockData(DateTime.Now, new List <Transactions> { new Transactions(moocEmailAddress, emailAddress, MicroCredential.CertificateFee) { MicroCredentials = new List <MicroCredential> { new MicroCredential { MicroCredentialId = MicroCredential.MicroCredentialId, /*MicroCredentialDescription = MicroCredential.MicroCredentialDescription,*/ MicroCredentialName = MicroCredential.MicroCredentialName } } } }); //Get RSAKeysFromDB var moocProvider = RepositoryEndPointService.GetMoocProviderFromDB(); RestoreMoocKeys(moocProvider); //Note We Sign with Mooc's Public Key. and Expose Private Key to the other parites to verify Mooc's Signature!! block.KeyModulus = moocProvider.MoocModulus; //Rsa316Engine.getModValue(); block.MoocPublicKey = moocProvider.MoocPublicKey; //Rsa316Engine.getPublicKey(); block.MoocSignature = CreateSignature(block); return(block); }
public string CreateSignature(string stratisBlockDataToSign) { var moocProvider = RepositoryEndPointService.GetMoocProviderFromDB(); RestoreMoocKeys(moocProvider); //Note: We are signing with Private Key var signBytes = Rsa316Engine.Encrypt(stratisBlockDataToSign); return(Convert.ToBase64String(signBytes)); }