using Kean.Infrastructure.Utilities;
namespace Kean.Domain.Identity.Models
{
///
/// 密码
///
public sealed class Password : ValueObject
{
///
/// 初始化 Kean.Domain.Identity.Models.Password 类的新实例
///
/// 明文
public Password(string clearText)
{
CipherText = Sha256Encoding.Encode(ClearText = clearText);
}
///
/// 明文
///
public string ClearText { get; }
///
/// 密文
///
public string CipherText { get; }
///
/// 以字符串表示密文
///
/// 密码
public static implicit operator string(Password password) => password.CipherText;
}
}