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
LevelDataSensitivityLevelThe sensitivity tier the key protects.
TenantIdstringThe owning tenant, or null for tenant-agnostic keys.
UserIdstringThe 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
TenantId
The owning tenant, or null for tenant-agnostic keys.
public string? TenantId { get; init; }
Property Value
UserId
The owning user, or null for non-user-scoped keys.
public string? UserId { get; init; }