public string DEBUGTEST() { // Test the possibility of encrypting using a Public key in the SecureStorage var output = "DEBUGTEST\n"; // Make key pair var asymmHelper = new AsymmetricKeyHelper("DEBUGTEST"); asymmHelper.CreateKey(); var serializedCertificate = asymmHelper.GetCertificate().GetEncoded(); var certificateEncrypter = new CertificateEncrypter("DEBUGTEST", serializedCertificate); var encryptedData = certificateEncrypter.EncryptData("This is a quick little test here/n"); // Run the externally encrypted data through internal decrypter output += asymmHelper.DecryptData(encryptedData); return(output); }
public string EncryptWithAnotherPublicKey(string messagePlaintext, string sharablePublicKey) { CertificateEncrypter ce = new CertificateEncrypter(sharablePublicKey); return(ce.EncryptDataToString(messagePlaintext)); }