1.5.3 • Published 3 years ago

@didww/encrypt v1.5.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

DIDWW Encrypt

npm

Encrypts files for DIDWW V3 API in browser.

see details at DIDWW Documentation

Install

npm install @didww/encrypt

Encryption demo

https://didww.github.io/didww-encrypt/

Usage

import DidwwEncrypt from '@didww/encrypt'

const encryptor = new DidwwEncrypt({
    environment: 'sandbox'
})

let fingerprint = null
encryptor.getFingerprint().then(res => fingerprint = res) // => instance of String with fingerprint of public keys

// smallest png in base64 for an example
const pngBase64 = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg=='
const pngFile = new File([atob(pngBase64)], 'test.png', { type: 'image/png', lastModified: new Date() })

let encryptedContainer = encryptor.encryptFile(pngFile).then(encrypted => {
    encryptedContainer.toFile() // => instance of File
    encryptedContainer.toArrayBuffer() // => instance of ArrayBuffer
    encryptedContainer.toString() // => instance of String in base64 format
})

or just load dist/browser.js to page and use window.DidwwEncrypt.

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago