public void readRawBytes(byte[] buf) throws BufferException { readRawBytes(buf, 0, buf.length); }
public BigInteger readUInt64AsBigInteger() throws BufferException { byte[] magnitude = new byte[8]; readRawBytes(magnitude); return new BigInteger(1, magnitude); }
/** * Read an SSH byte-array * * @return the byte-array read */ public byte[] readBytes() throws BufferException { int len = readUInt32AsInt(); if (len < 0 || len > 32768) throw new BufferException("Bad item length: " + len); byte[] b = new byte[len]; readRawBytes(b); return b; }
@Override public PublicKey readPubKeyFromBuffer(Buffer<?> buf) throws GeneralSecurityException { try { final int keyLen = buf.readUInt32AsInt(); final byte[] p = new byte[keyLen]; buf.readRawBytes(p); if (log.isDebugEnabled()) { log.debug(String.format("Key algo: %s, Key curve: 25519, Key Len: %s\np: %s", sType, keyLen, Arrays.toString(p)) ); } EdDSANamedCurveSpec ed25519 = EdDSANamedCurveTable.getByName("Ed25519"); EdDSAPublicKeySpec publicSpec = new EdDSAPublicKeySpec(p, ed25519); return new Ed25519PublicKey(publicSpec); } catch (Buffer.BufferException be) { throw new SSHRuntimeException(be); } }
buf.readRawBytes(x); buf.readRawBytes(y); if (log.isDebugEnabled()) { log.debug(String.format("Key algo: %s, Key curve: %s, Key Len: %s, 0x04: %s\nx: %s\ny: %s",
public void readRawBytes(byte[] buf) throws BufferException { readRawBytes(buf, 0, buf.length); }
public void readRawBytes(byte[] buf) throws BufferException { readRawBytes(buf, 0, buf.length); }
public BigInteger readUInt64AsBigInteger() throws BufferException { byte[] magnitude = new byte[8]; readRawBytes(magnitude); return new BigInteger(1, magnitude); }
/** * Read an SSH byte-array * * @return the byte-array read */ public byte[] readBytes() throws BufferException { int len = readUInt32AsInt(); if (len < 0 || len > 32768) throw new BufferException("Bad item length: " + len); byte[] b = new byte[len]; readRawBytes(b); return b; }
/** * Read an SSH byte-array * * @return the byte-array read */ public byte[] readBytes() throws BufferException { int len = readUInt32AsInt(); if (len < 0 || len > 32768) throw new BufferException("Bad item length: " + len); byte[] b = new byte[len]; readRawBytes(b); return b; }
@Override public PublicKey readPubKeyFromBuffer(Buffer<?> buf) throws GeneralSecurityException { try { final int keyLen = buf.readUInt32AsInt(); final byte[] p = new byte[keyLen]; buf.readRawBytes(p); if (log.isDebugEnabled()) { log.debug(String.format("Key algo: %s, Key curve: 25519, Key Len: %s\np: %s", sType, keyLen, Arrays.toString(p)) ); } EdDSANamedCurveSpec ed25519 = EdDSANamedCurveTable.getByName("Ed25519"); EdDSAPublicKeySpec publicSpec = new EdDSAPublicKeySpec(p, ed25519); return new Ed25519PublicKey(publicSpec); } catch (Buffer.BufferException be) { throw new SSHRuntimeException(be); } }
buf.readRawBytes(x); buf.readRawBytes(y); if (log.isDebugEnabled()) { log.debug(String.format("Key algo: %s, Key curve: %s, Key Len: %s, 0x04: %s\nx: %s\ny: %s",
final byte[] x = new byte[(keyLen - 1) / 2]; final byte[] y = new byte[(keyLen - 1) / 2]; buf.readRawBytes(x); buf.readRawBytes(y); if(log.isDebugEnabled()) { log.debug(String.format("Key algo: %s, Key curve: %s, Key Len: %s, 0x04: %s\nx: %s\ny: %s",