Skip to main content

SecretResult

Namespace: BlazorNative.Core

The terminal outcome of a secure get / getWithAuth: a status and, only when SecureStorageStatus.Ok, the stored value. Every other status carries a null value (the GeolocationResult twin). The value crosses the intra-process C-ABI as a UTF-8 string in the flat JSON {"value":…} payload — see the security note in docs/bridge-extension.md §(f).9: the wire is trusted (encryption is at rest, not on the wire); the POC's accepted hazard is the in-memory lifetime of non-zeroable plaintext copies, a zeroable-buffer hardening pass being M10. Binary secrets cross base64-encoded.

public readonly record struct SecretResult

Inheritance Object → ValueType → SecretResult
Implements IEquatable<SecretResult>
Attributes NullableContextAttribute, NullableAttribute, IsReadOnlyAttribute

Fields​

MaxValueBytes​

The soft cap on a secret value, enforced at the .NET boundary (an oversize value RETURNS a status — never crosses, never crashes). Secure storage is for secrets (tokens, keys), not blobs; a large value is a misuse, not a store. Recorded as a decision (§8).

public static int MaxValueBytes;

Properties​

Status​

The get outcome.

public SecureStorageStatus Status { get; init; }

Property Value​

SecureStorageStatus

Value​

The stored value on SecureStorageStatus.Ok, else null.

public string? Value { get; init; }

Property Value​

String

Constructors​

SecretResult(SecureStorageStatus, String)​

The terminal outcome of a secure get / getWithAuth: a status and, only when SecureStorageStatus.Ok, the stored value. Every other status carries a null value (the GeolocationResult twin). The value crosses the intra-process C-ABI as a UTF-8 string in the flat JSON {"value":…} payload — see the security note in docs/bridge-extension.md §(f).9: the wire is trusted (encryption is at rest, not on the wire); the POC's accepted hazard is the in-memory lifetime of non-zeroable plaintext copies, a zeroable-buffer hardening pass being M10. Binary secrets cross base64-encoded.

public SecretResult(SecureStorageStatus Status, string? Value)

Parameters​

Status SecureStorageStatus
The get outcome.

Value String?
The stored value on SecureStorageStatus.Ok, else null.