@opendatalabs/vana-sdk
Version:
A TypeScript library for interacting with Vana Network smart contracts.
60 lines (59 loc) • 1.98 kB
TypeScript
/**
* Shared PGP utilities for platform adapters
*
* IMPORTANT: This module contains NO IMPORTS to avoid affecting bundle loading.
* All functions are pure utilities that can be safely shared across platforms.
*/
/**
* Standard OpenPGP configuration for consistent behavior across platforms
* Uses enum values instead of importing openpgp to avoid loading issues
*/
export declare const STANDARD_PGP_CONFIG: {
readonly preferredCompressionAlgorithm: 2;
readonly preferredSymmetricAlgorithm: 7;
};
/**
* Process PGP key generation options with sensible defaults
*
* @param options - Optional key generation parameters
* @param options.name - The name for the PGP key (defaults to "Vana User")
* @param options.email - The email for the PGP key (defaults to "user@vana.org")
* @param options.passphrase - Optional passphrase to protect the private key
* @returns Processed options with defaults applied
*/
export declare function processPGPKeyOptions(options?: {
name?: string;
email?: string;
passphrase?: string;
}): {
name: string;
email: string;
passphrase: string | undefined;
};
/**
* Get standard PGP key generation parameters
* Combines default values with standard configuration
*
* @param options - Optional key generation parameters
* @param options.name - The name for the PGP key (defaults to "Vana User")
* @param options.email - The email for the PGP key (defaults to "user@vana.org")
* @param options.passphrase - Optional passphrase to protect the private key
* @returns Complete key generation parameters object
*/
export declare function getPGPKeyGenParams(options?: {
name?: string;
email?: string;
passphrase?: string;
}): {
type: "rsa";
rsaBits: number;
userIDs: {
name: string;
email: string;
}[];
passphrase: string | undefined;
config: {
readonly preferredCompressionAlgorithm: 2;
readonly preferredSymmetricAlgorithm: 7;
};
};