@microsoft/useragent-sdk
Version:
SDK for building decentralized identity wallets and enterprise agents.
27 lines (24 loc) • 1.09 kB
text/typescript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { SubtleCryptoElliptic } from '@microsoft/useragent-plugin-secp256k1';
import { CryptoFactory, IKeyStore } from '../..';
import { SubtleCrypto } from 'webcrypto-core';
/**
* Crypto operations class to return Elliptic subtle crypto
*/
export default class EllipticCryptoOperations extends CryptoFactory {
private elliptic: SubtleCrypto;
constructor(keyStore: IKeyStore, crypto: SubtleCrypto) {
super(keyStore, crypto);
this.elliptic = new SubtleCryptoElliptic(crypto);
}
/**
* Gets all of the message signing Algorithms from the plugin
* @returns a subtle crypto object for message signing
*/
public getMessageSigners (): SubtleCrypto {
return this.elliptic;
}
}