New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@abstraxn/passkey-manager

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@abstraxn/passkey-manager

@abstraxn/passkey-manager is an npm package that provides a set of utilities and classes for creating and managing WebAuthn passkeys, extracting signatures, and handling local storage formats. The package is designed with an object-oriented approach, maki

  • 0.0.12
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
0
Weekly downloads
 
Created
Source

Abstraxn - Passkey Manager Package

The Passkey package provides utilities for handling WebAuthn passkeys, local storage, and signature extraction. It simplifies the process of creating, storing, and verifying passkeys using WebAuthn (Web Authentication) API, enabling secure authentication mechanisms in web applications.

Features

  • Passkey Creation: Generate passkeys using WebAuthn API.
  • Signature Extraction: Extract and decode signatures from authenticator responses.
  • Local Storage Management: Store and retrieve passkeys securely in local storage.
  • TypeScript Support: Written in TypeScript for type-safe usage.

Installation

Install the Passkey manager package from npm:

npm install @abstraxn/passkey-manager

Usage

Creating a Passkey

To create a passkey:

import { createPasskey, getPassKey, toLocalStorageFormat, isLocalStoragePasskey, extractSignature, extractClientDataFields } from '@abstraxn/passkey-manager''

async function main() {
  try {
    // Create a passkey
    const passkey = await createPasskey("username");

    console.log("Passkey created:", passkey);

    // Store passkey in local storage format
    const passkeyLocalStorageFormat = toLocalStorageFormat(passkey);
    console.log("Passkey stored in local storage format:", passkeyLocalStorageFormat);

  } catch (error) {
    console.error("Error creating passkey:", error);
  }
}

main();

Creating a Passkey

To retrieve a passkey:

const { getPassKey } = require('passkey');

async function main() {
  try {
    // Retrieve passkey
    const passkey = await getPassKey();

    console.log("Retrieved passkey:", passkey);

  } catch (error) {
    console.error("Error retrieving passkey:", error);
  }
}

main();

Additional Functions

  • extractSignature(signature: ArrayBuffer | Uint8Array): [bigint, bigint]: Extracts R and S values from an authenticator signature.
  • extractClientDataFields(response: AuthenticatorAssertionResponse): { field: string, clientDataJSON: string }: Extracts additional client data fields from an authenticator response.

License

This package is MIT licensed. (c) Antier Solutions 2024.

Authors

  • @sandeep_sj
  • @antiersolutions

Keywords

FAQs

Package last updated on 04 Nov 2024

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