/** * Writes Java byte-array as an SSH byte-array * * @param b Java byte-array * * @return this */ public T putBytes(byte[] b) { return putBytes(b, 0, b.length); }
public T putString(byte[] str, int offset, int len) { return putBytes(str, offset, len); }
public T putString(byte[] str) { return putBytes(str); }
@Override protected void writePubKeyContentsIntoBuffer(PublicKey pk, Buffer<?> buf) { EdDSAPublicKey key = (EdDSAPublicKey) pk; buf.putBytes(key.getAbyte()); }
static void writePubKeyContentsIntoBuffer(PublicKey pk, Buffer<?> buf) { final ECPublicKey ecdsa = (ECPublicKey) pk; byte[] encoded = SecgUtils.getEncoded(ecdsa.getW(), ecdsa.getParams().getCurve()); buf.putString("nistp" + Integer.toString(fieldSizeFromKey(ecdsa))) .putBytes(encoded); }
static void writePubKeyContentsIntoBuffer(PublicKey publicKey, KeyType innerKeyType, Buffer<?> buf) { Certificate<PublicKey> certificate = toCertificate(publicKey); buf.putBytes(certificate.getNonce()); innerKeyType.writePubKeyContentsIntoBuffer(certificate.getKey(), buf); buf.putUInt64(certificate.getSerial()) .putUInt32(certificate.getType()) .putString(certificate.getId()) .putBytes(packList(certificate.getValidPrincipals())) .putUInt64(epochFromDate(certificate.getValidAfter())) .putUInt64(epochFromDate(certificate.getValidBefore())) .putBytes(packMap(certificate.getCritOptions())) .putBytes(packMap(certificate.getExtensions())) .putString("") // reserved .putBytes(certificate.getSignatureKey()) .putBytes(certificate.getSignature()); }
/** * Writes Java byte-array as an SSH byte-array * * @param b Java byte-array * * @return this */ public T putBytes(byte[] b) { return putBytes(b, 0, b.length); }
/** * Writes Java byte-array as an SSH byte-array * * @param b Java byte-array * * @return this */ public T putBytes(byte[] b) { return putBytes(b, 0, b.length); }
public T putString(byte[] str) { return putBytes(str); }
public T putString(byte[] str, int offset, int len) { return putBytes(str, offset, len); }
public T putString(byte[] str) { return putBytes(str); }
public T putString(byte[] str, int offset, int len) { return putBytes(str, offset, len); }
@Override protected void writePubKeyContentsIntoBuffer(PublicKey pk, Buffer<?> buf) { EdDSAPublicKey key = (EdDSAPublicKey) pk; buf.putBytes(key.getAbyte()); }
static void writePubKeyContentsIntoBuffer(PublicKey pk, Buffer<?> buf) { final ECPublicKey ecdsa = (ECPublicKey) pk; byte[] encoded = SecgUtils.getEncoded(ecdsa.getW(), ecdsa.getParams().getCurve()); buf.putString("nistp" + Integer.toString(fieldSizeFromKey(ecdsa))) .putBytes(encoded); }
static void writePubKeyContentsIntoBuffer(PublicKey publicKey, KeyType innerKeyType, Buffer<?> buf) { Certificate<PublicKey> certificate = toCertificate(publicKey); buf.putBytes(certificate.getNonce()); innerKeyType.writePubKeyContentsIntoBuffer(certificate.getKey(), buf); buf.putUInt64(certificate.getSerial()) .putUInt32(certificate.getType()) .putString(certificate.getId()) .putBytes(packList(certificate.getValidPrincipals())) .putUInt64(epochFromDate(certificate.getValidAfter())) .putUInt64(epochFromDate(certificate.getValidBefore())) .putBytes(packMap(certificate.getCritOptions())) .putBytes(packMap(certificate.getExtensions())) .putString("") // reserved .putBytes(certificate.getSignatureKey()) .putBytes(certificate.getSignature()); }