@microsoft/useragent-sdk
Version:
SDK for building decentralized identity wallets and enterprise agents.
74 lines • 2.39 kB
JavaScript
;
/*---------------------------------------------------------------------------------------------
* 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 CryptoOptions_1 = require("./CryptoOptions");
/**
* Interface defining options for the
* User Agent, such as resolver and register.
*/
class UserAgentOptions {
/**
* Instanciate a new instance of @class UserAgentOptions
* @param cryptoFactory Optional parameter specifying the crypto factory
*/
constructor(cryptoFactory) {
/**
* The timeout when making requests to
* external services.
*/
this.timeoutInSeconds = 30;
/**
* The locale to be used by the
* user agent.
*/
this.locale = 'en';
/**
* The lifetime of any self-issued credentials.
* Used to determine the expiry time of the
* credential.
*/
this.selfIssuedCredentialLifetimeInSeconds = 300; // 5 mins
/**
* Crypto Options
* contains algorithm and other data about crypto
*/
this.cryptoOptions = new CryptoOptions_1.default();
/**
* Prefix for the generated did.
*/
this.didPrefix = 'did:ion';
if (cryptoFactory) {
this.cryptoFactory = cryptoFactory;
this.cryptoOptions = new CryptoOptions_1.default(cryptoFactory);
}
}
/**
* Get the key store
*/
get keyStore() {
return this.cryptoOptions.cryptoFactory.keyStore;
}
/**
* Set the key store
*/
set keyStore(keyStore) {
this.cryptoOptions.cryptoFactory.keyStore = keyStore;
}
/**
* Get the crypto operations
*/
get cryptoFactory() {
return this.cryptoOptions.cryptoFactory;
}
/**
* Set the key store
*/
set cryptoFactory(cryptoFactory) {
this.cryptoOptions.cryptoFactory = cryptoFactory;
}
}
exports.default = UserAgentOptions;
//# sourceMappingURL=UserAgentOptions.js.map