certificate-fhir-convertor

    1.2.1 • Public • Published

    Certificate FHIR Converter

    This module is used to convert certificates issued by DIVOC to signed FHIR compliant json

    Quickstart

    To convert a DIVOC issued W3C certificate to FHIR R4 Json.

    1. Install

    npm install certificate-fhir-convertor

    2. Calling certificateToFhirJson with W3C certificate payload

    const {certificateToFhirJson} = require("certificate-fhir-convertor");
    const privateKeyPem = '-----BEGIN RSA PRIVATE KEY-----\nPRIVATE_KEY\n-----END RSA PRIVATE KEY-----\n';
    
    try {
        const fhirJson = certificateToFhirJson(certificate, privateKeyPem);
        console.log(fhirJson);
    } catch (err) {
        console.error(err);
        // handle the error case
    }

    3. Verify certificateToFhirJson

    const {validateSignedFhirJson} = require("certificate-fhir-convertor");
    const publicKeyPem = '-----BEGIN PUBLIC KEY-----\nPUBLIC_KEY\n-----END PUBLIC KEY-----';
    
    const valid = validateSignedFhirJson(certificate, publicKeyPem);
    console.log(valid);

    Install

    npm i certificate-fhir-convertor

    DownloadsWeekly Downloads

    3

    Version

    1.2.1

    License

    GPL-3.0-or-later

    Unpacked Size

    22.3 kB

    Total Files

    6

    Last publish

    Collaborators

    • samarthgr