@microsoft/useragent-sdk
Version:
SDK for building decentralized identity wallets and enterprise agents.
29 lines • 1.51 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const src_1 = require("../../../src");
const KeyTypeFactory_1 = require("../../../src/crypto/keys/KeyTypeFactory");
const KeyUseFactory_1 = require("../../../src/crypto/keys/KeyUseFactory");
const PublicKey_1 = require("../../../src/crypto/keys/PublicKey");
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
describe('PublicKey', () => {
it('should create an instance of a PublicKey', () => {
const publicKey = {
kty: KeyTypeFactory_1.KeyType.RSA,
use: KeyUseFactory_1.KeyUse.Signature,
alg: 'RS256',
kid: '#key1',
key_ops: [PublicKey_1.KeyOperation.Verify]
};
const key = new src_1.RsaPublicKey(publicKey);
expect(key.kty).toEqual(KeyTypeFactory_1.KeyType.RSA);
expect(key.use).toEqual(KeyUseFactory_1.KeyUse.Signature);
expect(key.kty).toEqual(KeyTypeFactory_1.KeyType.RSA);
expect(key.alg).toEqual('RS256');
expect(key.kid).toEqual('#key1');
expect(key.key_ops).toEqual([PublicKey_1.KeyOperation.Verify]);
});
});
//# sourceMappingURL=PublicKey.spec.js.map