# certmap

> Empowering effortless certificate information retrieval and registration

Latest version **0.2.48** (published 2024-10-01) · Open BSV License license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install certmap
pnpm add certmap
yarn add certmap
bun add certmap
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.48 |
| Published | 2024-10-01 |
| First published | 2023-08-22 |
| Weekly downloads | 0 |
| License | Open BSV License |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 100.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Peer-to-peer Privacy Systems Research LLC |
| Maintainers | tyeverett, braydude, tonesnotes |

## Links

- npm: https://www.npmjs.com/package/certmap
- npm.io page: https://npm.io/package/certmap

## Dependencies (10)

- [dotenv](https://npm.io/package/dotenv.md) ^8.2.0
- [cwi-base](https://npm.io/package/cwi-base.md) ^0.4.49
- [pushdrop](https://npm.io/package/pushdrop.md) ^0.1.64
- [sendover](https://npm.io/package/sendover.md) ^1.3.27
- [authrite-js](https://npm.io/package/authrite-js.md) ^0.4.36
- [documentation](https://npm.io/package/documentation.md) ^14.0.2
- [authrite-utils](https://npm.io/package/authrite-utils.md) ^0.3.36
- [@babbage/sdk-ts](https://npm.io/package/@babbage/sdk-ts.md) ^0.2.54
- [confederacy-base](https://npm.io/package/confederacy-base.md) ^0.1.2
- [cwi-external-services](https://npm.io/package/cwi-external-services.md) ^0.4.59

## Recent versions

- 0.2.48 (latest) — 2024-10-01
- 0.2.47 — 2024-09-21
- 0.2.46 — 2024-08-06
- 0.2.45 — 2024-07-18
- 0.2.44 — 2024-07-18
- 0.2.43 — 2024-07-17
- 0.2.42 — 2024-07-17
- 0.2.41 — 2024-07-17
- 0.2.40 — 2024-07-17
- 0.2.39 — 2024-07-17
- 0.2.38 — 2024-07-17
- 0.2.37 — 2024-07-07
- 0.2.36 — 2024-06-19
- 0.2.35 — 2024-06-07
- 0.2.34 — 2024-05-11
- … 74 more at https://npm.io/package/certmap/versions

## README

# CertMap

[![npm version](https://badge.fury.io/js/certmap.svg)](https://badge.fury.io/js/certmap)

CertMap is a library that redefines certificate access within the MetaNet ecosystem. When encountering a certificate access grant, CertMap resolves the type ID to comprehensive information about the certificate type, showcasing its name, icon, and other essential details. This approach empowers users with a clear understanding of the certificate's nature and purpose, aiding them in informed decisions about granting access to their personal information. Seamlessly integrate CertMap to enhance the transparency of certificate interactions on the MetaNet.

## Installation

Simply use npm to include CertMap in your project:

```bash
npm install certmap
```

## Usage

You can easily register and resolve certificate types by following the example code below.

*Note: You must have your MetaNet Client running in order for this to work!*

```javascript
import { CertMap } from 'certmap'

const init = async () => {
    const certMap = new CertMap()
    
    // Register a new certificate
    await certMap.registerNewCertificateType(
        'z40BOInXkI8m7f/wBrv4MJ09bZfzZbTj2fJqCtONqCY=',
        'SigniCert Certifier',
        'uhrp://abcdefg', 
        'Babbage identity certifier used to verify users within the Babbage MetaNet Client.',
        'https://projectbabbage.com',
        {
            firstName: 'First name of the user being certified',
            profileName: 'Last name of the user being certified',
            profilePhoto: 'UHRP URL of a verified profile photo of the user being certified'
        }
    )

    // Resolve certificate type information using registryOperator, and type
    const certificateTypeInfo= await certMap.resolveCertificateType(
        '032e5bd6b837cfb30208bbb1d571db9ddf2fb1a7b59fb4ed2a31af632699f770a1', 
        'z40BOInXkI8m7f/wBrv4MJ09bZfzZbTj2fJqCtONqCY='
    )
    console.log(certificateTypeInfo)
    /**
     * Example Response
     {
            type: 'z40BOInXkI8m7f/wBrv4MJ09bZfzZbTj2fJqCtONqCY=',
            name: 'SigniCert Certifier',
            iconURL: 'uhrp://abcdefg',
            description: 'Babbage identity certifier used to verify users within the Babbage MetaNet Client.',
            documentationURL: 'https://projectbabbage.com',
            fields: {
                firstName: 'First name of the user being certified',
                profileName: 'Last name of the user being certified',
                profilePhoto: 'UHRP URL of a verified profile photo of the user being certified'
            }
            registryOperator: '032e5bd6b837cfb30208bbb1d571db9ddf2fb1a7b59fb4ed2a31af632699f770a1'
       }
    **/
}
init()
```

## API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

#### Table of Contents

*   [CertMap](#certmap)
    *   [Parameters](#parameters)
    *   [registerNewCertificateType](#registernewcertificatetype)
        *   [Parameters](#parameters-1)
    *   [resolveCertificateByType](#resolvecertificatebytype)
        *   [Parameters](#parameters-2)
    *   [resolveCertificateByName](#resolvecertificatebyname)
        *   [Parameters](#parameters-3)
    *   [listOwnRegistryEntries](#listownregistryentries)
    *   [revokeOwnRegistryEntry](#revokeownregistryentry)
        *   [Parameters](#parameters-4)

### CertMap

Make informed decisions about who can access your personal information

#### Parameters

*   `` &#x20;
*   `config` **ConfederacyConfig**&#x20;

#### registerNewCertificateType

Register a new certificate type

##### Parameters

*   `type` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
*   `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
*   `iconURL` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
*   `description` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
*   `documentationURL` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
*   `fields` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** An object whose keys are field names, and whose values are objects, where each field object contains a human-readable field name, and a human-readable field description

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<void>**&#x20;

#### resolveCertificateByType

Resolves a certificate type from it's metadata

##### Parameters

*   `type` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** identifier of the certificate type
*   `registryOperators` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**&#x20;
*   `registryOperator`  the operator of the certificate type registration to resolve

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\<CertMapRecord>>**&#x20;

#### resolveCertificateByName

Resolves certificate information by name

##### Parameters

*   `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name associated with a particular certificate type
*   `registryOperators` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**&#x20;
*   `registryOperator`  the operator of the certificate type registration to resolve

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\<CertMapRecord>>**&#x20;

#### listOwnRegistryEntries

Gets all the certificate type registry entries from a user's basket

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\<CertMapRecord>>**&#x20;

#### revokeOwnRegistryEntry

Revokes a owned certificate type registration

##### Parameters

*   `entry` **CertMapRecord** certificate type registration entry to revoke

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<void>**&#x20;

## License

The license for the code in this repository is the Open BSV License

---
_Source: https://npm.io/package/certmap · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
