Class DataProtectionCryptoProvider
- Namespace
- Apq.Cfg.Crypto.DataProtection
- Assembly
- Apq.Cfg.Crypto.DataProtection.dll
使用 ASP.NET Core Data Protection 的加密提供者
public class DataProtectionCryptoProvider : ICryptoProvider
- Inheritance
-
DataProtectionCryptoProvider
- Implements
- Inherited Members
Remarks
Data Protection 提供了跨机器、跨应用的密钥管理和加密功能。 适用于 ASP.NET Core 应用程序,支持密钥轮换和撤销。
Constructors
DataProtectionCryptoProvider(IDataProtectionProvider, string)
初始化 Data Protection 加密提供者
public DataProtectionCryptoProvider(IDataProtectionProvider provider, string purpose = "Apq.Cfg")
Parameters
providerIDataProtectionProviderData Protection 提供者
purposestring保护目的,用于隔离不同用途的加密数据
Methods
Decrypt(string)
解密密文
public string Decrypt(string cipherText)
Parameters
cipherTextstring密文
Returns
- string
明文
Encrypt(string)
加密明文
public string Encrypt(string plainText)
Parameters
plainTextstring明文
Returns
- string
加密后的字符串