@dotrino/identity 0.55.0 → 0.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/node.js +2 -0
- package/vault/core.js +23 -0
package/package.json
CHANGED
package/src/node.js
CHANGED
|
@@ -179,6 +179,8 @@ export class Identity {
|
|
|
179
179
|
*/
|
|
180
180
|
/** Abre un sobre sellado A ESTE aparato (envoltura + sobre). Ver `core.js`. */
|
|
181
181
|
openSealedValue (wrap, envelope) { return this._h('openSealedValue', { wrap, envelope }) }
|
|
182
|
+
/** Re-envuelve para otro miembro una llave que este aparato ya puede abrir. */
|
|
183
|
+
rewrapFor (wrap, encPub) { return this._h('rewrapFor', { wrap, encPub }) }
|
|
182
184
|
setSealKeyProvider (provider) { return this._h('setSealKeyProvider', { provider }) }
|
|
183
185
|
/** Estrena la llave de sellado en un acta nueva, sin tocar a ningún miembro. */
|
|
184
186
|
rotateSealKey () { return this._h('rotateSealKey') }
|
package/vault/core.js
CHANGED
|
@@ -1667,6 +1667,29 @@ export async function createIdentityCore ({ kv: rawKv, peers, makeSync = null, k
|
|
|
1667
1667
|
return Content.decryptWithCek({ cek, envelope })
|
|
1668
1668
|
},
|
|
1669
1669
|
|
|
1670
|
+
/**
|
|
1671
|
+
* RE-ENVUELVE para otro miembro una llave que este aparato ya puede abrir.
|
|
1672
|
+
*
|
|
1673
|
+
* Es lo que permite completar a un aparato que entró tarde **sin la frase del
|
|
1674
|
+
* perfil y sin que la bóveda tenga que abrir nada**: quien administra ya tiene su
|
|
1675
|
+
* envoltura de ese cajón —por eso puede pulsar «Ver»—, así que abre la llave con la
|
|
1676
|
+
* suya, que no sale de este dispositivo, y la vuelve a envolver para la pública del
|
|
1677
|
+
* recién llegado.
|
|
1678
|
+
*
|
|
1679
|
+
* No regala nada: quien hace esto ya podía leer ese cajón, y a quien se lo entrega
|
|
1680
|
+
* es a alguien que el ACTA —firmada por la maestra— ya reconoce como miembro. La
|
|
1681
|
+
* autorización es el acta; esto solo es el sobre.
|
|
1682
|
+
*
|
|
1683
|
+
* @param {{ wrap: any, encPub: string }} o `wrap`: mi envoltura · `encPub`: la
|
|
1684
|
+
* pública de cifrado del miembro al que hay que envolvérsela.
|
|
1685
|
+
* @returns {Promise<any>} la envoltura nueva, para que la bóveda la guarde.
|
|
1686
|
+
*/
|
|
1687
|
+
async rewrapFor ({ wrap, encPub } = {}) {
|
|
1688
|
+
if (!wrap || !encPub) throw new Error('rewrapFor: missing the wrap or the recipient key')
|
|
1689
|
+
const cek = await Content.openWrap({ wrap, myEncPrivateKey: encKeypair.privateKey })
|
|
1690
|
+
return Content.wrapForMember({ cek, memberEncPub: encPub })
|
|
1691
|
+
},
|
|
1692
|
+
|
|
1670
1693
|
/** Abre un sobre de contenido con el llavero del perfil (todas las generaciones). */
|
|
1671
1694
|
async openContent ({ envelope } = {}) {
|
|
1672
1695
|
return Content.decryptWithKeyring({
|