# GeneratedApiKey

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.generatedapikey/
> Summary: GeneratedApiKey: The generated raw API key value and its derived forms.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

The generated raw API key value and its derived forms.

```csharp
public sealed record GeneratedApiKey : IEquatable<GeneratedApiKey>
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.generatedapikey/">GeneratedApiKey</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable&lt;GeneratedApiKey&gt;</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Constructors

### <a id="Tracon_GeneratedApiKey__ctor"></a> GeneratedApiKey\(\)

```csharp
public GeneratedApiKey()
```

## Properties

### <a id="Tracon_GeneratedApiKey_KeyHash"></a> KeyHash

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

```csharp
public required byte[] KeyHash { get; init; }
```

#### Property Value

 [byte](https://learn.microsoft.com/dotnet/api/system.byte)\[\]

### <a id="Tracon_GeneratedApiKey_KeyPrefix"></a> KeyPrefix

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

```csharp
public required string KeyPrefix { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

### <a id="Tracon_GeneratedApiKey_PlaintextKey"></a> PlaintextKey

The raw value. Visible only at creation time.

```csharp
public required string PlaintextKey { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Methods

### <a id="Tracon_GeneratedApiKey_Equals_System_Object_"></a> Equals\(object?\)

```csharp
public override bool Equals(object? obj)
```

#### Parameters

`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_GeneratedApiKey_Equals_Tracon_GeneratedApiKey_"></a> Equals\(GeneratedApiKey?\)

```csharp
public bool Equals(GeneratedApiKey? other)
```

#### Parameters

`other` [GeneratedApiKey](/api/tracon.generatedapikey/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_GeneratedApiKey_GetHashCode"></a> GetHashCode\(\)

```csharp
public override int GetHashCode()
```

#### Returns

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_GeneratedApiKey_ToString"></a> ToString\(\)

Returns a description that carries no raw key.

```csharp
public override string ToString()
```

#### Returns

 [string](https://learn.microsoft.com/dotnet/api/system.string)

The type name and the prefix; never the raw value.

#### Remarks

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.

## Operators

### <a id="Tracon_GeneratedApiKey_op_Equality_Tracon_GeneratedApiKey_Tracon_GeneratedApiKey_"></a> operator ==\(GeneratedApiKey?, GeneratedApiKey?\)

```csharp
public static bool operator ==(GeneratedApiKey? left, GeneratedApiKey? right)
```

#### Parameters

`left` [GeneratedApiKey](/api/tracon.generatedapikey/)?

`right` [GeneratedApiKey](/api/tracon.generatedapikey/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_GeneratedApiKey_op_Inequality_Tracon_GeneratedApiKey_Tracon_GeneratedApiKey_"></a> operator \!=\(GeneratedApiKey?, GeneratedApiKey?\)

```csharp
public static bool operator !=(GeneratedApiKey? left, GeneratedApiKey? right)
```

#### Parameters

`left` [GeneratedApiKey](/api/tracon.generatedapikey/)?

`right` [GeneratedApiKey](/api/tracon.generatedapikey/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
