Class KeyMaterial
- Namespace
- Stratara.Abstractions.Security
- Assembly
- Stratara.Abstractions.dll
A resolved data-encryption key: its stable id plus the raw key bytes. Returned by GetOrCreateCurrentKeyAsync(KeyScope, CancellationToken) so callers obtain both the id (to persist alongside the ciphertext) and the key (to perform the encryption) in a single call.
public sealed record KeyMaterial : IEquatable<KeyMaterial>
- Inheritance
-
KeyMaterial
- Implements
- Inherited Members
- Extension Methods
Constructors
KeyMaterial(string, ReadOnlyMemory<byte>)
A resolved data-encryption key: its stable id plus the raw key bytes. Returned by GetOrCreateCurrentKeyAsync(KeyScope, CancellationToken) so callers obtain both the id (to persist alongside the ciphertext) and the key (to perform the encryption) in a single call.
public KeyMaterial(string KeyId, ReadOnlyMemory<byte> Key)
Parameters
KeyIdstringThe stable id of the key, persisted with the ciphertext for later resolution.
KeyReadOnlyMemory<byte>The raw key bytes. Callers should zero their copy after use.
Properties
Key
The raw key bytes. Callers should zero their copy after use.
public ReadOnlyMemory<byte> Key { get; init; }
Property Value
KeyId
The stable id of the key, persisted with the ciphertext for later resolution.
public string KeyId { get; init; }