/// <summary> /// Re-encrypts a secret from a different X509Alias and stores it in this X509Alias /// </summary> /// <param name="key">The identifier of the secret as it is stored in the old X509Alias</param> /// <param name="OldAlias">The old X509Alias where the secret is currently encrypted and stored</param> /// <param name="overwriteExisting">If true, an existing secret in this X509Alias with the same identifier may be overwritten</param> /// <returns>A Base64-encoded ciphertext expression</returns> public string AddSecret(string key, X509Alias OldAlias, bool overwriteExisting) { return(AddSecret(key, OldAlias.RecoverSecret(key), overwriteExisting)); }
/// <summary> /// Re-Encrypts a secret that is stored in a different X509Alias /// </summary> /// <param name="secretName">The identifier of the secret to be re-encrypted</param> /// <param name="OldAlias">The X509Alias where the secret is stored</param> /// <returns>A Base64-encoded ciphtertext string</returns> public string ReEncryptSecret(string secretName, X509Alias OldAlias) { string plaintext = OldAlias.RecoverSecret(secretName); return(EncryptText(plaintext)); }