Table of Contents

Class SopsFile

Namespace
Nops.Core
Assembly
Nops.Core.dll

Main entry point for SOPS file decryption. Loads, decrypts, and returns ordered trees, flattened key-values, or typed objects.

public static class SopsFile
Inheritance
SopsFile
Inherited Members

Methods

DecryptAsync<T>(byte[], string, SopsOptions, CancellationToken)

Decrypt a SOPS file and deserialize to a typed object. Types are preserved (int, float, bool, bytes as base64, time as ISO-8601).

public static Task<T> DecryptAsync<T>(byte[] fileBytes, string fileKind, SopsOptions options, CancellationToken ct = default)

Parameters

fileBytes byte[]
fileKind string
options SopsOptions
ct CancellationToken

Returns

Task<T>

Type Parameters

T

DecryptToDictionaryAsync(byte[], string, SopsOptions, CancellationToken)

Decrypt a SOPS file and return flattened key-value pairs. Keys are ":"-joined paths (e.g., "app.db.user"); arrays use ":index" (e.g., "list.0.x").

public static Task<IReadOnlyDictionary<string, string>> DecryptToDictionaryAsync(byte[] fileBytes, string fileKind, SopsOptions options, CancellationToken ct = default)

Parameters

fileBytes byte[]
fileKind string
options SopsOptions
ct CancellationToken

Returns

Task<IReadOnlyDictionary<string, string>>

DecryptTreeAsync(byte[], string, SopsOptions, CancellationToken)

Decrypt a SOPS file and return the ordered tree. MAC is verified before returning.

public static Task<SopsTree> DecryptTreeAsync(byte[] fileBytes, string fileKind, SopsOptions options, CancellationToken ct = default)

Parameters

fileBytes byte[]
fileKind string
options SopsOptions
ct CancellationToken

Returns

Task<SopsTree>