verifiablecredentials-crypto-sdk-typescript-keystore
Version:
Package for managing keys in a key store.
42 lines • 2.56 kB
JavaScript
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
const index_1 = require("../lib/index");
describe('KeyStoreOptions', () => {
it('should set the options', async () => {
let options = new index_1.KeyStoreOptions();
expect(options.latestVersion).toBeTruthy();
expect(options.publicKeyOnly).toBeTruthy();
options = new index_1.KeyStoreOptions({ extractable: false });
expect(options.latestVersion).toBeTruthy();
expect(options.publicKeyOnly).toBeTruthy();
options = new index_1.KeyStoreOptions({ latestVersion: false });
expect(options.latestVersion).toBeFalsy();
expect(options.publicKeyOnly).toBeTruthy();
options = new index_1.KeyStoreOptions({ publicKeyOnly: false });
expect(options.latestVersion).toBeTruthy();
expect(options.publicKeyOnly).toBeFalsy();
options = new index_1.KeyStoreOptions({ extractable: false, latestVersion: false });
expect(options.latestVersion).toBeFalsy();
expect(options.publicKeyOnly).toBeTruthy();
options = new index_1.KeyStoreOptions({ extractable: false, latestVersion: true });
expect(options.latestVersion).toBeTruthy();
expect(options.publicKeyOnly).toBeTruthy();
options = new index_1.KeyStoreOptions({ extractable: false, latestVersion: true, publicKeyOnly: false });
expect(options.latestVersion).toBeTruthy();
expect(options.publicKeyOnly).toBeFalsy();
options = new index_1.KeyStoreOptions({ extractable: true, latestVersion: true, publicKeyOnly: false });
expect(options.latestVersion).toBeTruthy();
expect(options.publicKeyOnly).toBeFalsy();
options = new index_1.KeyStoreOptions({ extractable: true, latestVersion: true, publicKeyOnly: true });
expect(options.latestVersion).toBeTruthy();
expect(options.publicKeyOnly).toBeTruthy();
options = new index_1.KeyStoreOptions({ extractable: false, latestVersion: false, publicKeyOnly: false });
expect(options.latestVersion).toBeFalsy();
expect(options.publicKeyOnly).toBeFalsy();
});
});
//# sourceMappingURL=KeyStoreOptions.spec.js.map