Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tkey/security-questions

Package Overview
Dependencies
Maintainers
4
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tkey/security-questions

TKey Security Questions Module

  • 6.2.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

tKey Security Questions Module

npm version minzip

The tKey Security Questions Module helps you add or remove the and password as a share for tkey. This module is the part of the tKey SDK.

Installation

npm install --save @tkey/security-questions

Initialization

Import the SecurityQuestionsModule class from @tkey/security-questions
import SecurityQuestionsModule from "@tkey/security-questions";
Assign the SecurityQuestionsModule class to a variable
const securityQuestionsModule = new SecurityQuestionsModule(params);

Parameters

params

  • saveAnswers?: boolean

Returns

The SecurityQuestionsModule class returns an object with the following properties:

class SecurityQuestionsModule implements IModule {
  moduleName: string;
  tbSDK: ITKeyApi;
  saveAnswers: boolean;
  constructor(saveAnswers?: boolean);
  static refreshSecurityQuestionsMiddleware(generalStore: unknown, oldShareStores: ShareStoreMap, newShareStores: ShareStoreMap): unknown;
  setModuleReferences(tbSDK: ITKeyApi): void;
  initialize(): Promise<void>;
  generateNewShareWithSecurityQuestions(answerString: string, questions: string): Promise<GenerateNewShareResult>;
  getSecurityQuestions(): string;
  inputShareFromSecurityQuestions(answerString: string): Promise<void>;
  changeSecurityQuestionAndAnswer(newAnswerString: string, newQuestions: string): Promise<void>;
  saveAnswerOnTkeyStore(answerString: string): Promise<void>;
  getAnswer(): Promise<string>;
}

Usage

With the SecurityQuestionsModule, you've access to the following functions:

Generate new share with security questions

generateNewShareWithSecurityQuestions(answerString: string, questions: string)
  • answerString: Answer corresponding to a security question
  • questions: The secutity question
Return
  • Promise<GenerateNewShareResult>: The GenerateNewShareResult object
GenerateNewShareResult
declare type GenerateNewShareResult = {
  newShareStores: ShareStoreMap;
  newShareIndex: BN;
};
export declare type ShareStoreMap = {
  [shareIndex: string]: ShareStore;
};
declare class ShareStore implements ISerializable {
  share: Share;
  polynomialID: PolynomialID;
  constructor(share: Share, polynomialID: PolynomialID);
  static fromJSON(value: StringifiedType): ShareStore;
  toJSON(): StringifiedType;
}

Get Security Question

getSecurityQuestions()
Return
  • string: The security question

Input share from security question

inputShareFromSecurityQuestions(answerString: string)
  • answerString: Answer corresponding to the security question

Change Security Question and Answer

changeSecurityQuestionAndAnswer(newAnswerString: string, newQuestions: string)
  • newAnswerString: Answer corresponding to the new security question
  • newQuestions: The new secutity question

Save answer on tkey store

saveAnswerOnTkeyStore(answerString: string)
  • answerString: Answer corresponding to the security question

Get answer

getAnswer
Return
  • string: The answer corresponding to the security question

FAQs

Package last updated on 29 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc