<commit_before>const compPKI = require('./pki-compiled');
const _ = require('lodash');
window.db = require('idb-kv-store');
const certified = require('./certified');
const api = require('./api');

function showResult(result) {
	var element = document.createElement('div');
	element.innerHTML = result;
	document.body.appendChild(element);
}

function storeKeys(keyPair) {
	storeKeyValue(db,'public',keyPair.publicKey);
	storeKeyValue(db,'private',keyPair.privateKey);
}

window.storeKeys = storeKeys;

function definePersonaCSR(
	persona='o',
	host='heka.house',
	instance='default',
	namespace='private:services',
	locality='Columbus',
	state='Ohio',
	country='US') {
	return {
		'CN': persona+'.'+host,
		'O' : host,
		'OU': 'WebId:persona',
		'L' : locality,
		'S' : state,
		'C' : country,
		'GN': instance,
		'SN': namespace
	};
}

// certified.generateRSAKeyPair()<commit_msg>initial static framework<commit_after>const compPKI = require('./pki-compiled');
const _ = require('lodash');
window.db = require('idb-kv-store');
const certified = require('./certified');
const api = require('./api');

function showResult(result) {
	var element = document.createElement('div');
	element.innerHTML = result;
	document.body.appendChild(element);
}

function storeKeys(keyPair) {
	storeKeyValue(db,'public',keyPair.publicKey);
	storeKeyValue(db,'private',keyPair.privateKey);
}

window.storeKeys = storeKeys;

function definePersonaCSR(
	persona='o',
	host='heka.house',
	instance='default',
	namespace='private:services',
	locality='Columbus',
	state='Ohio',
	country='US') {
	return {
		'CN': persona+'.'+host,
		'O' : host,
		'OU': 'WebId:persona',
		'L' : locality,
		'S' : state,
		'C' : country,
		'GN': instance,
		'SN': namespace
	};
}

window.definePersonaCSR = definePersonaCSR;

// certified.generateRSAKeyPair()
{'fraction_non_alphanumeric': 0.18296703296703296, 'fraction_numerical': 0.0, 'mean_word_length': 5.694852941176471, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '770301', 'n_tokens_mistral': 651, 'n_tokens_neox': 622, 'n_words': 111}