MCPcopy Create free account
hub / github.com/mscdex/ssh2 / genOpenSSHEdPub

Function genOpenSSHEdPub

lib/protocol/keyParser.js:249–259  ·  view source on GitHub ↗
(pub)

Source from the content-addressed store, hash-verified

247}
248
249function genOpenSSHEdPub(pub) {
250 const publicKey = Buffer.allocUnsafe(4 + 11 + 4 + pub.length);
251
252 writeUInt32BE(publicKey, 11, 0);
253 publicKey.utf8Write('ssh-ed25519', 4, 11);
254
255 writeUInt32BE(publicKey, pub.length, 15);
256 publicKey.set(pub, 19);
257
258 return publicKey;
259}
260
261function genOpenSSLEdPriv(priv) {
262 const asnWriter = new Ber.Writer();

Callers 2

parseOpenSSHPrivKeysFunction · 0.85
parseDERFunction · 0.85

Calls 1

writeUInt32BEFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…