Socket
Book a DemoInstallSign in
Socket

worldcerts-verifier

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

worldcerts-verifier

Library to verify any opencerts document

1.0.2
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

@govtechsg/opencerts-verify

CircleCI

Library to verify any Opencerts document. This library extends @govtechsg/oa-verify.

Installation

npm install @govtechsg/opencerts-verify

Usage

import { documentMainnetValidWithCertificateStore } from "./test/fixtures/v2/document";
import { verify, isValid } from "@govtechsg/opencerts-verify";

const fragments = await verify(documentMainnetValidWithCertificateStore, { network: "ropsten" });
console.log(fragments); // see below
console.log(isValid(fragments)); // display true
[
  {
    "data": true,
    "status": "VALID",
    "name": "OpenAttestationHash",
    "type": "DOCUMENT_INTEGRITY"
  },
  {
    "data": {
      "details": [
        {
          "address": "0x007d40224f6562461633ccfbaffd359ebb2fc9ba",
          "issued": true
        }
      ],
      "issuedOnAll": true
    },
    "status": "VALID",
    "name": "OpenAttestationEthereumDocumentStoreIssued",
    "type": "DOCUMENT_STATUS"
  },
  {
    "message": "Document issuers doesn't have \"tokenRegistry\" property or TOKEN_REGISTRY method",
    "name": "OpenAttestationEthereumTokenRegistryMinted",
    "status": "SKIPPED",
    "type": "DOCUMENT_STATUS"
  },
  {
    "data": {
      "details": [
        {
          "address": "0x007d40224f6562461633ccfbaffd359ebb2fc9ba",
          "revoked": false
        }
      ],
      "revokedOnAny": false
    },
    "status": "VALID",
    "name": "OpenAttestationEthereumDocumentStoreRevoked",
    "type": "DOCUMENT_STATUS"
  },
  {
    "message": "Document issuers doesn't have \"documentStore\" / \"tokenRegistry\" property or doesn't use DNS-TXT type",
    "status": "SKIPPED",
    "name": "OpenAttestationDnsTxt",
    "type": "ISSUER_IDENTITY"
  },
  {
    "data": [
      {
        "status": "VALID",
        "value": "0x007d40224f6562461633ccfbaffd359ebb2fc9ba",
        "name": "Government Technology Agency of Singapore (GovTech)",
        "displayCard": true,
        "website": "https://www.tech.gov.sg",
        "email": "info@tech.gov.sg",
        "phone": "+65 6211 2100",
        "logo": "/static/images/GOVTECH_logo.png",
        "id": "govtech-registry"
      }
    ],
    "name": "OpencertsRegistryVerifier",
    "status": "VALID",
    "type": "ISSUER_IDENTITY"
  }
]

Differences with @govtechsg/oa-verify

OpencertsRegistryVerifier

OpencertsRegistryVerifier is a new verifier specific to Opencerts documents:

  • it ensures document ISSUER_IDENTITY and works closely with OpenAttestationDnsTxt verifier (see isValid below)
  • it returns a VALID fragment if at least one of the issuer is in Opencerts registry
  • it returns a SKIPPED fragment if none of the issuers is in the registry.

isValid

With the addition of OpencertsRegistryVerifier verifier, different rules apply for ISSUER_IDENTITY type verifiers:

  • ISSUER_IDENTITY is valid if at least one issuer is in the registry, i.e. if OpencertsRegistryVerifier has status VALID
  • if OpencertsRegistryVerifier doesn't have VALID status then all issuers must have valid DNS-TXT record.

API

Table of Contents

License

GPL-3.0

FAQs

Package last updated on 01 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.