Skip to main content
Table of Contents

Struct KeyScope

Namespace
Stratara.Abstractions.Security
Assembly
Stratara.Abstractions.dll

Identifies the scope a data-encryption key belongs to: a DataSensitivityLevel optionally narrowed to a tenant and/or user. The IKeyStore derives a stable key id from this scope.

public readonly record struct KeyScope : IEquatable<KeyScope>
Implements
Inherited Members
Extension Methods

Remarks

TenantId and UserId are string (not Guid) so the scope carries both opaque slug identifiers and GUID values (via Guid.ToString()) without loss.

Constructors

KeyScope(DataSensitivityLevel, string?, string?)

Identifies the scope a data-encryption key belongs to: a DataSensitivityLevel optionally narrowed to a tenant and/or user. The IKeyStore derives a stable key id from this scope.

public KeyScope(DataSensitivityLevel Level, string? TenantId = null, string? UserId = null)

Parameters

Level DataSensitivityLevel

The sensitivity tier the key protects.

TenantId string

The owning tenant, or null for tenant-agnostic keys.

UserId string

The owning user, or null for non-user-scoped keys.

Remarks

TenantId and UserId are string (not Guid) so the scope carries both opaque slug identifiers and GUID values (via Guid.ToString()) without loss.

Properties

Level

The sensitivity tier the key protects.

public DataSensitivityLevel Level { get; init; }

Property Value

DataSensitivityLevel

TenantId

The owning tenant, or null for tenant-agnostic keys.

public string? TenantId { get; init; }

Property Value

string

UserId

The owning user, or null for non-user-scoped keys.

public string? UserId { get; init; }

Property Value

string