Class Secret
- Namespace
- Codebelt.SharedKernel.Security
- Assembly
- Codebelt.SharedKernel.dll
Represents a Secret object that can be used for storing sensitive data.
public class Secret : Token, IEquatable<ValueObject>, IEquatable<SingleValueObject<string>>, IEquatable<Token>, IEquatable<Secret>
- Inheritance
-
ObjectSingleValueObject<String>Secret
- Implements
-
IEquatable<ValueObject>IEquatable<Token>IEquatable<Secret>
- Inherited Members
-
SingleValueObject<String>.PrintMembers(StringBuilder)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
value
GuidThe System.Guid value to assign the role of Secret.
Secret(String)
Initializes a new instance of the Secret class.
public Secret(string value)
Parameters
value
StringThe System.String value to assign the role of Secret.
Exceptions
- System.ArgumentNullException
value
cannot be null.- System.ArgumentException
value
cannot be empty or consist only of white-space characters.- System.ArgumentOutOfRangeException
value
contained one or more white-space characters -or-value
was less than 32 characters -or-value
was greater than 128 characters -or-value
consist 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
setup
Action<EncodingOptions>The EncodingOptions which may be configured.
Returns
- Byte[]
A byte[] that is equivalent to this instance.
ToString()
Returns a System.String> that represents this instance.
public override string ToString()
Returns
- String
A System.String> that represents this instance.
Operators
Implicit(Guid to Secret)
Performs an implicit conversion from System.Guid to Secret.
public static implicit operator Secret(Guid value)
Parameters
value
GuidThe value to convert.
Returns
Implicit(String to Secret)
Performs an implicit conversion from System.String to Secret.
public static implicit operator Secret(string value)
Parameters
value
StringThe value to convert.