Table of Contents

Class AgeMasterKey

Namespace
Nops.Core.Keys
Assembly
Nops.Core.dll

Master key provider for age (age-encryption.org/v1) keys. Decrypts X25519 recipients (what sops uses to wrap its data key); passphrase, post-quantum and plugin recipients are not supported.

public class AgeMasterKey : IMasterKeyProvider
Inheritance
AgeMasterKey
Implements
Inherited Members

Constructors

AgeMasterKey(string)

Creates an age master key from a private key.

public AgeMasterKey(string privateKey)

Parameters

privateKey string

The age private key (Bech32 string starting with "AGE-SECRET-KEY-1...").

Properties

KeyType

The key type identifier ("age").

public string KeyType { get; }

Property Value

string

PrivateKey

The age private key (Bech32 string starting with "AGE-SECRET-KEY-1...").

public string PrivateKey { get; }

Property Value

string

Methods

DecryptShareAsync(string, CancellationToken)

Decrypt the encrypted data key share using age. Returns null if this key cannot decrypt it: the private key is not valid or the file is not addressed to it. A malformed or tampered age blob throws InvalidDataException.

public Task<byte[]?> DecryptShareAsync(string enc, CancellationToken ct = default)

Parameters

enc string
ct CancellationToken

Returns

Task<byte[]>