open-index/open-npm huggingface dataset:
npm package: @s1r-j/fido2server-lib
Description: Module to help implement FIDO2 server.
Author: s1r-J
Latest version: 0.3.0

# @s1r-j/fido2server-lib

[![npm version](https://badge.fury.io/js/@s1r-j%2Ffido2server-lib.svg)](https://badge.fury.io/js/@s1r-j%2Ffido2server-lib) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

Module to help implement FIDO2 server.

## Description

This module is influenced by [fido2-lib](https://www.npmjs.com/package/fido2-lib).

I checks this module in [demo app](https://github.com/s1r-J/fido2-demoserver) with [self-conformance test tools](https://fidoalliance.org/certification/functional-certification/conformance/).
Also I tests interoperability between server and authenticator(Windows Hello).

### Attestation

Supported attestations is below.

- None
- Packed
- TPM
- Android Key
- Android SafetyNet
- FIDO U2F
- Apple

### Algorithm

Supported algorithms is below.

- ES256(`-7`)
- RS256(`-257`)
- RS384(`-258`)
- RS512(`-259`)
- RS1(`-65535`)
- PS256(`-37`)
- PS384(`-38`)
- PS512(`-39`)
- ES384(`-35`)
- ES512(`-36`)
- ES256K(`-47`)
- EdDSA(`-8`)

### WebAuthn extensions

Supported [WebAuthn extensions](https://www.w3.org/TR/webauthn-2/#sctn-extensions) is below.

Note: Test is not performed.

- FIDO AppID Extension (appid)
- FIDO AppID Exclusion Extension (appidExclude)
- User Verification Method Extension (uvm)
- Credential Properties Extension (credProps)
- Large blob storage extension (largeBlob)
- Credential Protection extension (credProtect)

## Demo

[Demo app](https://github.com/s1r-J/fido2-demoserver)

Demo app is FIDO2 server using this module.

## Usage

### Import

ESM

```javascript
import FSL from '@s1r-j/fido2server-lib';
const {
  AttestationCreationOptionsBuilder,
  AttestationExpectationBuilder,
  AttestationResponseVerifier,
  AttestationResponseParser,
  AssertionRequestOptionsBuilder,
  AssertionExpectationBuilder,
  AssertionResponseVerifier,
  AssertionResponseParser,
} = FSL;
```

CommonJS

```javascript
const FSL = require('@s1r-j/fido2server-lib');
```

## Install

[npm](https://www.npmjs.com/package/@s1r-j/fido2server-lib)

```
npm i @s1r-j/fido2server-lib
```

## Contribution

This module has many issues.

- No tests
- No documents and not enough typescript comments
- TODOs in source

etc...

## License

[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0.html)

## Author

[s1r-J](https://github.com/s1r-J)
npm package: @s1seven/js-bigchaindb-key-derivation
Description: Key derivation for BigChainDB
Author: getlarge
Latest version: 0.2.0
Deprecated: this package has been deprecated

# `key-derivation`

Heavily inspired by [stellar-hd-wallet](https://github.com/chatch/stellar-hd-wallet).
Complies to [BIP44] and [SLIP10].

## Usage

### TODO: DEMONSTRATE API

```
const BigChainWallet = require('@s1seven/js-bigchain-key-derivation');

```

## TODOs

### Account discovery

In an extra module ?

- implement account discovery :
- [BIP44 spec](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account-discovery)
- [oip-hdmw](https://oipwg.github.io/oip-hdmw/Account.js.html)
- [bip32-utils](https://github.com/oipwg/bip32-utils/blob/master/chain.js)
- With a query like :

```ts
async accountDiscovery(account: number | string, index: number, attempt = 0): Promise<boolean> {
  const conn = new Connection(this.networkUrl);
  const publicKey = this.getPublicKey(index, 'base58');
  // ? only check unspent ?
  const unspentTransactions = await conn.listOutputs(publicKey, false);
  const spentTransactions = await conn.listOutputs(publicKey, true);
  const transactions = [...unspentTransactions, ...spentTransactions];
  if (transactions.length) {
    return false;
  }
  if (!transactions.length) {
    return this.accountDiscovery(account, (index += 1), (attempt += 1));
  }
  if (attempt === 20) {
    return true;
  }
  return false;
}
```

- add third property if keypair has unspent transaction ?
- check that previous account has transaction history

### DER / KeyObject / PEM encoding

- Add missing alg to export as DER/PEM/Keyobject X25519 private key

[bip44]: https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki
[slip10]: https://github.com/satoshilabs/slips/blob/master/slip-0010.md