Skip to content

GeneratedApiKey

Namespace AgentPrism · Assembly AgentPrism.Core.dll

The generated raw API key value and its derived forms.

public sealed record GeneratedApiKey : IEquatable<GeneratedApiKey>

objectGeneratedApiKey

IEquatable<GeneratedApiKey>

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

public GeneratedApiKey()

The SHA-256 hash of the raw value. The only form written to the store.

public required byte[] KeyHash { get; init; }

byte[]

The first characters of the raw value; used to distinguish it in a list.

public required string KeyPrefix { get; init; }

string

The raw value. Visible only at creation time.

public required string PlaintextKey { get; init; }

string

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(GeneratedApiKey? other)

other GeneratedApiKey?

bool

public override int GetHashCode()

int

Returns a description that carries no raw key.

public override string ToString()

string

The type name and the prefix; never the raw value.

A record’s compiler-generated ToString prints every property. The prefix is safe to show - it is what the list view displays - but the raw value is not.

operator ==(GeneratedApiKey?, GeneratedApiKey?)

Section titled “ operator ==(GeneratedApiKey?, GeneratedApiKey?)”
public static bool operator ==(GeneratedApiKey? left, GeneratedApiKey? right)

left GeneratedApiKey?

right GeneratedApiKey?

bool

operator !=(GeneratedApiKey?, GeneratedApiKey?)

Section titled “ operator !=(GeneratedApiKey?, GeneratedApiKey?)”
public static bool operator !=(GeneratedApiKey? left, GeneratedApiKey? right)

left GeneratedApiKey?

right GeneratedApiKey?

bool