Class Secret
- Namespace
- Codebelt.SharedKernel.Security
- Assembly
- Codebelt.SharedKernel.dll
Represents a Secret object that can be used for storing sensitive data.
public record Secret : Token, IEquatable<ValueObject>, IEquatable<SingleValueObject<string>>, IEquatable<Token>, IEquatable<Secret>
- Inheritance
-
objectSecret
- Implements
- Inherited Members
-
SingleValueObject<string>.GetHashCode()SingleValueObject<string>.Equals(object)SingleValueObject<string>.Equals(ValueObject)SingleValueObject<string>.Equals(SingleValueObject<string>)SingleValueObject<string>.<Clone>$()SingleValueObject<string>.EqualityContract
Remarks
Constructors
Secret(Guid)
Initializes a new instance of the Secret class.
public Secret(Guid value)
Parameters
Secret(string)
Initializes a new instance of the Secret class.
public Secret(string value)
Parameters
Exceptions
- ArgumentNullException
valuecannot be null.- ArgumentException
valuecannot be empty or consist only of white-space characters.- ArgumentOutOfRangeException
valuecontained one or more white-space characters -or-valuewas less than 32 characters -or-valuewas greater than 128 characters -or-valueconsist only of same repeated character.
Methods
ToByteArray(Action<EncodingOptions>)
Converts this instance to its equivalent byte[] representation.
public byte[] ToByteArray(Action<EncodingOptions> setup = null)
Parameters
setupAction<EncodingOptions>The EncodingOptions which may be configured.
Returns
- byte[]
A byte[] that is equivalent to this instance.
ToString()
Returns a string> that represents this instance.
public override string ToString()
Returns
Operators
implicit operator Secret(Guid)
public static implicit operator Secret(Guid value)
Parameters
valueGuidThe value to convert.
Returns
implicit operator Secret(string)
public static implicit operator Secret(string value)
Parameters
valuestringThe value to convert.