Table of Contents

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
object
Secret
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

value Guid

The Guid value to assign the role of Secret.

Secret(string)

Initializes a new instance of the Secret class.

public Secret(string value)

Parameters

value string

The string value to assign the role of Secret.

Exceptions

ArgumentNullException

value cannot be null.

ArgumentException

value cannot be empty or consist only of white-space characters.

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 string> that represents this instance.

public override string ToString()

Returns

string

A string> that represents this instance.

Operators

implicit operator Secret(Guid)

Performs an implicit conversion from Guid to Secret.

public static implicit operator Secret(Guid value)

Parameters

value Guid

The value to convert.

Returns

Secret

A Secret that is equivalent to value.

implicit operator Secret(string)

Performs an implicit conversion from string to Secret.

public static implicit operator Secret(string value)

Parameters

value string

The value to convert.

Returns

Secret

A Secret that is equivalent to value.

See Also