MCPcopy Index your code
hub / github.com/mailvelope/mailvelope / createKeyring

Function createKeyring

src/modules/keyring.js:159–175  ·  view source on GitHub ↗
(keyringId)

Source from the content-addressed store, hash-verified

157 * @return {KeyringBase}
158 */
159export async function createKeyring(keyringId) {
160 await keyringInitialized;
161 if (keyringAttr.has(keyringId)) {
162 throw new MvError(`Keyring for id ${keyringId} already exists.`, 'KEYRING_ALREADY_EXISTS');
163 }
164 // persist keyring attributes
165 await keyringAttr.create(keyringId);
166 try {
167 // instantiate keyring
168 const keyRng = await buildKeyring(keyringId);
169 return keyRng;
170 } catch (e) {
171 // cleanup
172 await keyringAttr.delete(keyringId);
173 throw e;
174 }
175}
176
177/**
178 * Instantiate a new keyring object, keys are loaded from the keystore

Callers 3

test-harness.jsFile · 0.90
keyring-test.jsFile · 0.90
createKeyringMethod · 0.90

Calls 4

buildKeyringFunction · 0.85
hasMethod · 0.45
createMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected