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

@sirosfoundation/wscd-manager-wasm

v0.3.4

Published

Pluggable WSCD manager for EUDI wallet key operations

Readme

siros-wscd-manager

CI OpenSSF Scorecard License: BSD-2-Clause

Pluggable WSCD (Wallet Secure Cryptographic Device) manager for the SIROS EUDI wallet.

Architecture

┌─────────────────────────────────────────────────────┐
│  Mobile SDK (Kotlin/Swift via UniFFI)                │
│  ┌──────────────────────────────────────────┐       │
│  │         WscdManager                       │       │
│  │  ┌──────────┬──────────┬──────────┐      │       │
│  │  │ SoftkeyP │ R2psP    │ FIDO2P   │      │       │
│  │  │ (JWE)    │ (HSM)    │ (rawSign)│      │       │
│  │  └──────────┴──────────┴──────────┘      │       │
│  └──────────────────────────────────────────┘       │
│        ▲             ▲             ▲                 │
│   AuthCallback  ProgressCallback  Ctap2Transport    │
│   (PIN/WebAuthn)  (UI spinners)   (BLE/NFC relay)   │
└─────────────────────────────────────────────────────┘

Plugins

| Plugin | Backend | Auth | Status | | ------ | ------- | ---- | ------ | | softkey | Software P-256/Ed25519 container (host must JWE-encrypt before persisting) | None | ✅ Implemented | | r2ps | Remote PKCS#11 HSM via R2PS | OPAQUE / WebAuthn | ✅ Implemented (feature-gated) | | fido2 | Yubico previewSign (CTAP2 rawSign) | FIDO2 | ✅ Implemented |

Key Features

  • Plugin resolution: per-key binding → per-operation default → global default
  • Auth callbacks: PIN entry (OPAQUE), WebAuthn assertion — host provides UI
  • Progress callbacks: async state pushed to SDK for spinner/progress UI
  • Key migration: move keys between plugins, with re-enrollment signaling
  • Lifecycle API: explicit register/activate/rotate/destroy operations for plugin-bound trust contexts
  • Zeroize: private key material zeroized on drop

Lifecycle API

The manager now exposes a lifecycle surface in addition to key operations, so plugin registration and teardown are explicit and testable.

Lifecycle operations:

  • register_lifecycle - establish registration bindings for a context
  • activate_lifecycle - authenticate/activate a registered context
  • rotate_lifecycle - rotate bound registration material
  • destroy_lifecycle - destroy local bindings and optionally attempt remote revoke
  • lifecycle_status - inspect current lifecycle state per context

Key lifecycle concepts:

  • FactorKind: Opaque, WebAuthn, RawSign
  • LifecycleState: Uninitialized, Registered, Active, Suspended, Destroyed
  • DestroyMode: LocalOnly, RemoteRevokeIfSupported, Strict

Current lifecycle support

  • r2ps: lifecycle implemented (register = OPAQUE/WebAuthn, activate = OPAQUE/WebAuthn auth, rotate = re-registration, destroy = local + optional remote revoke by DestroyMode)
  • fido2 (preview_sign): lifecycle implemented for RawSign (register/rotate provision bound keys, activate marks context active, destroy performs local key-binding teardown)
  • softkey: lifecycle not implemented (returns Unsupported)

Usage

use siros_wscd_manager::*;
use siros_wscd_manager::plugins::softkey::SoftkeyPlugin;
use std::sync::Arc;

let mut manager = WscdManager::new(WscdConfig::default());
manager.register_plugin(Arc::new(SoftkeyPlugin::new()));

// Generate and sign (requires AuthCallback + ProgressCallback impls)
let key = manager.generate_key(Algorithm::ES256, &auth, &progress).await?;
let sig = manager.sign(&key.kid, b"data", Algorithm::ES256, &auth, &progress).await?;

Building

cargo build                          # default (softkey only)
cargo build --features plugin-r2ps   # with R2PS support
cargo test

Development

cargo fmt --all -- --check           # check formatting
cargo clippy --all-features -- -D warnings  # lint
cargo test                           # run tests
cargo test --features plugin-r2ps    # test with R2PS plugin

Crate Structure

src/
├── lib.rs           # Public re-exports
├── error.rs         # WscdError enum
├── types.rs         # Key/lifecycle domain types and operation results
├── traits.rs        # WscdPlugin trait (+ lifecycle defaults)
├── callbacks.rs     # AuthCallback, ProgressCallback, Ctap2Transport traits
├── config.rs        # WscdConfig, R2psConfig
├── manager.rs       # WscdManager (key and lifecycle routing)
└── plugins/
    ├── mod.rs
    ├── softkey.rs   # SoftkeyPlugin (JWE container, P-256 ECDSA)
    └── r2ps.rs      # R2psPlugin (remote PKCS#11 HSM via R2PS protocol)
    └── preview_sign.rs  # PreviewSignPlugin (FIDO2 rawSign / Yubico previewSign)

Features

| Feature | Default | Description | | ------- | :-----: | ----------- | | plugin-softkey | ✅ | Software key store (JWE-encrypted P-256 container) | | plugin-r2ps | | Remote PKCS#11 HSM signing via r2ps-client | | plugin-fido2 | | Yubico previewSign / CTAP2 rawSign |

License

BSD-2-Clause