di-wings
Version:
Aviary Tech's common library for decentralized identity
47 lines • 1.58 kB
TypeScript
import { AESKW } from '@stablelib/aes-kw';
export interface CreateKekOptions {
keyData: Uint8Array;
}
export interface WrapKeyOptions {
unwrappedKey: Uint8Array;
}
export interface UnwrapKeyOptions {
wrappedKey: string;
}
export declare class KeyEncryptionKey {
aeskw: AESKW;
algorithm: any;
static createKek: ({ keyData }: CreateKekOptions) => Promise<KeyEncryptionKey>;
constructor(key: Uint8Array);
/**
* Wraps a cryptographic key.
*
* @param {object} options - The options to use.
* @param {Uint8Array} options.unwrappedKey - The key material as a
* `Uint8Array`.
*
* @returns {string} - The base64url-encoded wrapped key bytes.
*/
wrapKey({ unwrappedKey }: WrapKeyOptions): string;
/**
* Unwraps a cryptographic key.
*
* @param {object} options - The options to use.
* @param {string} options.wrappedKey - The wrapped key material as a
* base64url-encoded string.
*
* @returns {Uint8Array} - Resolves to the key bytes or null if
* the unwrapping fails because the key does not match.
*/
unwrapKey({ wrappedKey }: UnwrapKeyOptions): Uint8Array | null;
static fromStaticPeer: (KeyPair: any) => ({ ephemeralKeyPair, staticPublicKey }: any) => Promise<{
kek: KeyEncryptionKey;
epk: any;
apu: string;
apv: string;
}>;
static fromEphemeralPeer: (KeyPairClass: any) => ({ keyAgreementKey, epk }: any) => Promise<{
kek: KeyEncryptionKey;
}>;
}
//# sourceMappingURL=KeyEncryptionKey.d.ts.map