UNPKG

smartid-calls

Version:

Smart-ID client module for Node.JS with proxy layer

42 lines (41 loc) 1.88 kB
import { ModuleConfigI } from './types/Request'; export declare class SmartID { private config; constructor(config: ModuleConfigI); /** * Initiates the authentification with SmartID * @param country string country ISO name * @param idNumber string personal number of the individual * @param displayText string text to show for the enduser */ authenticate(country: string, idNumber: string, displayText: string): Promise<any>; /** * Queries SmartID for desired certificates * @param document object|string either document number or object with country and personal nubmer * @param level string Level of the certificate to look for */ getSigningCert(document: { country: string; personalNumber: string; } | string, level?: string): Promise<any>; /** * Initiates the signing procedure on the users device * @param documentNumber string document identifier to use for signing * @param digestToSign string base64 encoded hash for signing * @param displayText string text to show for the end user */ sign(documentNumber: string, digestToSign: string, displayText: string): Promise<any>; /** * Verifies whether certificate is valid and optionally can check whether the signed data is received properly * @param sessionId string smartid session identifier * @param prevRequest previous request for verification * @param authHash original data used to create digest for signing */ verifyRequest(sessionId: string, prevRequest: object, authHash?: string): Promise<any>; /** * Polls and waits for user action and afterwards returns the information associated with previous request. * @param sessionId string SmartID session identifier */ getSession(sessionId: string): Promise<any>; } export default SmartID;