UNPKG

@rize-labs/paas

Version:

Passkey management module for all your passkey requirements

23 lines (22 loc) 1.29 kB
import { IWebAuthnRegistrationResponse, ISignatureResponse, IWebAuthnSignatureRequest } from "./types/WebAuthnTypes"; /** * Registers a new Passkey by creating a public key credential. * @returns public keys (x,y) co-ordinate and encodedId in a json. */ export declare const register: () => Promise<IWebAuthnRegistrationResponse>; /** * Checks the authentication of a user by signing a message with Passkeys and verifying the signature. * @param message - The message to be signed. * @param encodedId - The encoded ID associated with the Passkeys. * @param eoaAddress - Public Key with (x,y) co-ordinates of the point on curve * @returns boolean value indicating whether the signature is valid or not. */ export declare const checkAuth: (message: string, encodedId: string, eoaAddress: [string, string]) => Promise<boolean>; /** * Signs a text using passkeys * @param message - text message to be signed * @param encodedId - identifier for passkeys * @param isMessageSignedNeeded - flag indicating if the signed message is needed. * @returns signature and signed message depending on the value of isMessageSignedNeeded . */ export declare const signMessageViaPassKeys: ({ message, encodedId, isMessageSignedNeeded }: IWebAuthnSignatureRequest) => Promise<ISignatureResponse>;