/// <summary> /// Gets the encrypted text by private key. /// </summary> /// <param name="text">The string to encrypt.</param> /// <param name="ignoreFormatIfNoCrypto">true if ignore format when no crypto set; otherwise, false.</param> /// <param name="padding">The optional padding mode for decryption.</param> /// <returns>The Base64 string with secret encrypted.</returns> public string EncryptText(SecureString text, bool ignoreFormatIfNoCrypto = false, RSAEncryptionPadding padding = null) { return(EncryptText(SecureStringExtensions.ToUnsecureString(text), ignoreFormatIfNoCrypto, padding)); }