npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-dpop

v0.3.0

Published

React Native library for DPoP proof generation and key management.

Downloads

293

Readme

react-native-dpop

React Native library for DPoP proof generation and key management.

Features

  • Generate DPoP proofs (dpop+jwt) signed with ES256.
  • Manage key pairs in the device keystore (create, rotate, delete).
  • Export public key in JWK, DER, or RAW format.
  • Calculate JWK thumbprint (SHA-256, base64url).
  • Verify if a proof is bound to a given key alias.
  • Retrieve non-sensitive key metadata (hardware-backed, StrongBox info, etc.).
  • iOS key storage uses Secure Enclave when available, with Keychain fallback.

Platform Support

  • Android: supported.
  • iOS: supported.

Installation

npm install react-native-dpop

For iOS, install pods in your app project:

cd ios && pod install

Quick Start

import { DPoP } from 'react-native-dpop';

const dpop = await DPoP.generateProof({
  htu: 'https://api.example.com/token',
  htm: 'POST',
  accessToken: 'ACCESS_TOKEN',
  nonce: 'server-nonce',
});

const proof = dpop.proof;
const thumbprint = await dpop.calculateThumbprint();
const publicJwk = await dpop.getPublicKey('JWK');
const isBound = await dpop.isBoundToAlias();

API

Types

  • GenerateProofInput
  • DPoPProofContext
  • DPoPKeyInfo
  • SecureHardwareFallbackReason = 'UNAVAILABLE' | 'PROVIDER_ERROR' | 'POLICY_REJECTED' | 'UNKNOWN'
  • PublicJwk
  • PublicKeyFormat = 'JWK' | 'DER' | 'RAW'

DPoP static methods

  • DPoP.generateProof(input): Promise<DPoP>
  • DPoP.assertHardwareBacked(alias?): Promise<void>
  • DPoP.deleteKeyPair(alias?): Promise<void>
  • DPoP.getKeyInfo(alias?): Promise<DPoPKeyInfo>
  • DPoP.hasKeyPair(alias?): Promise<boolean>
  • DPoP.rotateKeyPair(alias?): Promise<void>

DPoP instance fields

  • proof: string
  • proofContext: DPoPProofContext
  • alias?: string

DPoP instance methods

  • calculateThumbprint(): Promise<string>
  • getPublicKey(format): Promise<PublicJwk | string>
  • signWithDpopPrivateKey(payload): Promise<string>
  • isBoundToAlias(alias?): Promise<boolean>

Error Codes

Native errors are rejected with codes such as:

  • ERR_DPOP_GENERATE_PROOF
  • ERR_DPOP_CALCULATE_THUMBPRINT
  • ERR_DPOP_PUBLIC_KEY
  • ERR_DPOP_SIGN_WITH_PRIVATE_KEY
  • ERR_DPOP_HAS_KEY_PAIR
  • ERR_DPOP_GET_KEY_INFO
  • ERR_DPOP_ROTATE_KEY_PAIR
  • ERR_DPOP_DELETE_KEY_PAIR
  • ERR_DPOP_ASSERT_HARDWARE_BACKED
  • ERR_DPOP_IS_BOUND_TO_ALIAS

Notes

  • If no alias is provided, the default alias is react-native-dpop.
  • getKeyInfo returns cross-platform fields and platform-specific details in hardware:
    • Android: hardware.android.strongBoxAvailable, hardware.android.strongBoxBacked, hardware.android.securityLevel, hardware.android.strongBoxFallbackReason
    • iOS: hardware.ios.secureEnclaveAvailable, hardware.ios.secureEnclaveBacked, hardware.ios.securityLevel, hardware.ios.secureEnclaveFallbackReason
  • Fallback reasons are sanitized enums (no raw native error): UNAVAILABLE, PROVIDER_ERROR, POLICY_REJECTED, UNKNOWN.
  • securityLevel semantics:
    • null: no key material available (or not reported)
    • 1: not backed by secure enclave/strong dedicated hardware
    • 2: hardware-backed (iOS Secure Enclave, Android typically TEE)
    • 3: Android-only StrongBox (when reported by the device)
  • On iOS, securityLevel is normalized by this library (2 for Secure Enclave-backed keys, 1 for Keychain fallback), not a native Apple numeric level API.
  • htm is normalized to uppercase in proof generation.
  • ath is derived from accessToken (SHA-256, base64url) when provided.
  • jti and iat are auto-generated when omitted.

Contributing

License

MIT