-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
8 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ import { randomBytes } from 'ed25519-keygen/utils'; | |
import ssh from 'ed25519-keygen/ssh'; | ||
import { randomBytes } from 'ed25519-keygen/utils'; | ||
const sseed = randomBytes(32); | ||
const skeys = await ssh(sseed, '[email protected]'); | ||
const skeys = ssh(sseed, '[email protected]'); | ||
console.log(skeys.fingerprint); | ||
console.log(skeys.privateKey); | ||
console.log(skeys.publicKey); | ||
|
@@ -92,7 +92,7 @@ Quirks: | |
import * as pgp from 'ed25519-keygen/pgp'; | ||
import { randomBytes } from 'ed25519-keygen/utils'; | ||
const pseed = randomBytes(32); | ||
const pkeys = await pgp.getKeys(pseed, '[email protected]', 'password'); | ||
const pkeys = pgp.getKeys(pseed, '[email protected]', 'password'); | ||
console.log(pkeys.keyId); | ||
console.log(pkeys.privateKey); | ||
console.log(pkeys.publicKey); | ||
|
@@ -131,13 +131,13 @@ KmnxVEBpz5Vt5TldT/9ovAA= | |
*/ | ||
|
||
// Also, you can explore existing keys internal structure | ||
console.log(await pgp.pubArmor.decode(keys.publicKey)); | ||
const privDecoded = await pgp.privArmor.decode(keys.privateKey); | ||
console.log(pgp.pubArmor.decode(keys.publicKey)); | ||
const privDecoded = pgp.privArmor.decode(keys.privateKey); | ||
console.log(privDecoded); | ||
// And receive raw private keys as bigint | ||
console.log({ | ||
ed25519: await pgp.decodeSecretKey('password', privDecoded[0].data), | ||
cv25519: await pgp.decodeSecretKey('password', privDecoded[3].data), | ||
ed25519: pgp.decodeSecretKey('password', privDecoded[0].data), | ||
cv25519: pgp.decodeSecretKey('password', privDecoded[3].data), | ||
}); | ||
``` | ||
|
||
|
@@ -152,7 +152,7 @@ Generates TOR addresses. | |
import tor from 'ed25519-keygen/tor'; | ||
import { randomBytes } from 'ed25519-keygen/utils'; | ||
const tseed = randomBytes(32); | ||
const tkeys = await tor(tseed); | ||
const tkeys = tor(tseed); | ||
console.log(tkeys.privateKey); | ||
console.log(tkeys.publicKey); | ||
/* | ||
|
@@ -173,7 +173,7 @@ Generates IPNS addresses. | |
import ipns from 'ed25519-keygen/ipns'; | ||
import { randomBytes } from 'ed25519-keygen/utils'; | ||
const iseed = randomBytes(32); | ||
const ikeys = await ipns(iseed); | ||
const ikeys = ipns(iseed); | ||
console.log(ikeys.privateKey); | ||
console.log(ikeys.publicKey); | ||
console.log(ikeys.base16); | ||
|