open-index/open-npm huggingface dataset:
npm package: @silentcastle/did-util
Description: DID-related types and utils
Latest version: 1.1.1

# DID Util

Contains DID-related types and utils.

Exposed:

- `DIDDocument` - type for [JSON representation of DID document](https://www.w3.org/TR/did-core/#json),
- `DIDResolution` - type for DIDResolution, as the thing that DID resolver responds with,
- `ParsedDID` - [DID URL](https://www.w3.org/TR/did-core/#did-url-syntax) in parsed form,
- `parse` - transform DID URL string into `ParsedDID`,
- `IResolver` - interface for generic DID Resolver,
- `NoResolutionError` - error class to indicate unavailable resolution.

## Installation

```
pnpm add @siletncastle/did-util
```

## Usage

```ts
import { parse, ParsedDID } from "@silentcastle/did-util";
const didUrl = "did:key:z6DtMrg4Kv51UMAM8vJcCLcRywJfEB4dpHVxPCR6qm6hSV3N";
const parsed: ParsedDID = parse(didUrl);
```

## Licence

[Apache-2.0](https://opensource.org/licenses/Apache-2.0)
npm package: @silentcastle/keys
Description: Key management
Latest version: 2.1.0

# Keys

Un-opinionated public/private key representation for secp256k1 and ed25519 crypto systems.

## Install

Using [pnpm](https://pnpm.js.org):

```
pnpm add @silentcastle/keys
```

## Usage

Supported algorithms: secp256k1 and ed25519.

```ts
import { PrivateKeyFactory, AlgorithmKind } from '@silentcastle/keys';

// Get private key somehow. Here it is a managed instance.
const privateKeyFactory = new PrivateKeyFactory();
const privateKey = privateKeyFactory.fromSeed(AlgorithmKind.secp256k1, 'seed');
const publicKey = await privateKey.publicKey()

const message = new Uint8Array([1,2,3])
const signature = await privateKey.sign(new Uint8Array([1,2,3]))
const isSigned = await publicKey.verify(message, signature) // Expect true
```

## License

[MIT](https://opensource.org/licenses/MIT) or [Apache-2.0](https://opensource.org/licenses/Apache-2.0).
npm package: @silentcastle/remote-did-resolver
Description: Resolve DID Document from universal resolver endpoint
Latest version: 3.3.0

# Remote DID Resolver

Resolve DID by fetching DID Document from Uniresolver-like HTTP endpoint.

## Install

```shell script
npm add @silentcastle/remote-did-resolver
```

## Use

Configure endpoint and resolve the document, like you would do with [DIF did-resolver package](https://github.com/decentralized-identity/did-resolver)

```typescript
import { RemoteDidResolver } from "@silentcastle/remote-did-resolver";
const resolver = new RemoteDidResolver("https://dev.uniresolver.io");
const didDocument = await resolver.resolve(
  "did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6"
);
// Alternatively, to get full resolution, instead of just DID document.
const didResolution = await resolver.resolution("did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6")
didDocument == didResolution.didDocument //=> true
```

## License

Apache-2.0