1.0.6 • Published 3 years ago

@vereign/lib-seal v1.0.6

Weekly downloads
-
License
AGPL-3.0-or-later
Repository
-
Last release
3 years ago

Seal Library

Seal Library is an integration tool for reading sealed emails and using Iframe API to verify them.

Installation

  • Set up authentication to the company NPM account
  • $ yarn add @vereign/lib-seal @vereign/lib-mime @vereign/lib-png

    @vereign/lib-mime and @vereign/lib-png are required peer dependencies

Development and publishing

  • Set up authentication to the company NPM account using publish token or login via npm login/yarn login
  • npm publish/yarn publish

Development of the Iframe API

Any change in the Iframe API and its errors must be reflected in Public Iframe API documentation

Development of the SealService

Changes related to the:

  • Seal template must be reflected in Seal in Email documentation
  • Seal metadata must be reflected in Seal Metadata documentation
  • Seal ID and Seal URL must be reflected in glossary

API

SealService API

SealService provides a function to extract seals from mime. It depends on @vereign/lib-mime functionality of parsing the forwarded and replied parts of the MIME.

At the moment, it supports only Outlook and Gmail emails. To support other email platforms, relevant adjustments have to be applied to the @vereign/lib-mime

import { SealService } from "@vereign/lib-seal"

// Obtain MIME of the email
const mime = "...";

const {
    sealId,
    sealUrl,
    publicKey
} = await SealService.extractSealFromMime(mime)

// Proceed with the loading of the Iframe API

Iframe API

Load iframe API to perform sealing and sending of the email

import { IframeAPI } from "@vereign/lib-seal";

// Concept of the iframe Url explained here
// https://code.vereign.com/seal/documentation/-/tree/master/apis/iframe#iframe-url
iframeUrl = "https://seal-integrator.com/vframe";
const iframeAPI = await IframeAPI.loadAPI(iframeUrl);

// Integrator story related to sealing and sending explained here
// https://code.vereign.com/seal/building-blocks/iframe#sender-create-seal-send-a-message-via-outlook-add-inchrome-extension-and-publish-sender-status

await iframeAPI.destroy();

Load iframe API of sender to perform verification of the email

import { IframeAPI, StatusApiError, MimeVerificationError, SealApiError, SealService } from "@vereign/lib-seal"

// Obtain MIME of the email
const mime = "...";

const { sealUrl } = await SealService.extractSealFromMime(mime)

const senderIframeAPI = IframeAPI.loadAPIForSeal(sealUrl);

// Integrator story related to verification explained here
// https://code.vereign.com/seal/building-blocks/iframe#recipient-read-and-verify-email-publish-receipt-record

await senderIframeAPI.destroy()

Concepts and relevant documentation

License

AGPLv3

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago