age-encryption
Version:
<p align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://github.com/FiloSottile/age/blob/main/logo/logo_white.svg"> <source media="(prefers-color-scheme: light)" srcset="https://github.com/FiloSottile/a
28 lines (27 loc) • 1 kB
TypeScript
/**
* A stanza is a section of an age header. This is part of the low-level
* {@link Recipient} and {@link Identity} APIs.
*/
export declare class Stanza {
/**
* All space-separated arguments on the first line of the stanza.
* Each argument is a string that does not contain spaces.
* The first argument is often a recipient type, which should look like
* `example.com/...` to avoid collisions.
*/
readonly args: string[];
/**
* The raw body of the stanza. This is automatically base64-encoded and
* split into lines of 48 characters each.
*/
readonly body: Uint8Array;
constructor(args: string[], body: Uint8Array);
}
export declare function parseHeader(header: Uint8Array): {
stanzas: Stanza[];
MAC: Uint8Array;
headerNoMAC: Uint8Array;
rest: Uint8Array;
};
export declare function encodeHeaderNoMAC(recipients: Stanza[]): Uint8Array;
export declare function encodeHeader(recipients: Stanza[], MAC: Uint8Array): Uint8Array;