Live Table: https://diafygi.github.io/webcrypto-examples/
I couldn't find anywhere that had clear examples of WebCryptoAPI, so I wrote examples and made a live table with them. Pull requests welcome!
- generateKey | importKey |
# coding: utf-8 | |
from weasyprint import HTML, CSS | |
def get_page_body(boxes): | |
for box in boxes: | |
if box.element_tag == 'body': | |
return box |
Live Table: https://diafygi.github.io/webcrypto-examples/
I couldn't find anywhere that had clear examples of WebCryptoAPI, so I wrote examples and made a live table with them. Pull requests welcome!
const fs = require('fs'); | |
const crypto = require('crypto'); | |
const decB64 = b64 => Buffer.from(b64, 'base64').toString('ascii'); | |
const encB64 = ascii => Buffer.from(ascii).toString('base64'); | |
const saveKeyToFile = (filename, key) => | |
fs.writeFileSync(filename, key.export({ type: 'pkcs8', format: 'pem' })); | |
const loadKeyFromFile = filename => loadRawKey(fs.readFileSync(filename)); | |
const loadRawKey = raw => crypto.createPrivateKey(raw); |