UNPKG

@sphereon/ssi-sdk-ext.kms-musap-rn

Version:

Sphereon SSI-SDK react-native plugin for management of keys with musap.

52 lines (48 loc) 1.74 kB
import { ManagedKeyInfo, TKeyType, IKey, MinimalImportableKey } from '@veramo/core'; import { SscdType, ExternalSscdSettings } from '@sphereon/musap-react-native'; import { AbstractKeyManagementSystem } from '@veramo/key-manager'; declare class MusapKeyManagementSystem extends AbstractKeyManagementSystem { private musapClient; private readonly sscdType; private readonly sscdId; private readonly defaultKeyAttributes; private readonly defaultSignAttributes; constructor(sscdType?: SscdType, sscdId?: string, opts?: { externalSscdSettings?: ExternalSscdSettings; defaultKeyAttributes?: Record<string, string>; defaultSignAttributes?: Record<string, string>; }); listKeys(): Promise<ManagedKeyInfo[]>; createKey(args: { type: TKeyType; meta?: KeyMetadata; }): Promise<ManagedKeyInfo>; private mapKeyTypeToAlgorithmType; private mapAlgorithmTypeToKeyType; deleteKey({ kid }: { kid: string; }): Promise<boolean>; private determineAlgorithm; sign(args: { keyRef: Pick<IKey, 'kid'>; algorithm?: string; data: Uint8Array; [x: string]: any; }): Promise<string>; importKey(args: Omit<MinimalImportableKey, 'kms'> & { privateKeyPEM?: string; }): Promise<ManagedKeyInfo>; private decodeMusapPublicKey; private asMusapKeyInfo; sharedSecret(args: { myKeyRef: Pick<IKey, 'kid'>; theirKey: Pick<IKey, 'publicKeyHex' | 'type'>; }): Promise<string>; private recordToKeyAttributes; private recordToSignatureAttributes; } interface KeyMetadata { algorithms?: string[]; [x: string]: any; } export { type KeyMetadata, MusapKeyManagementSystem };