public static void writeOpaque24(byte[] buf, OutputStream output) throws IOException { checkUint24(buf.length); writeUint24(buf.length, output); output.write(buf); }
public static void writeOpaque24(byte[] buf, OutputStream output) throws IOException { checkUint24(buf.length); writeUint24(buf.length, output); output.write(buf); }
void writeToRecordStream() throws IOException { // Patch actual length back in int length = count - 4; TlsUtils.checkUint24(length); TlsUtils.writeUint24(length, buf, 1); writeHandshakeMessage(buf, 0, count); buf = null; } }
void writeToRecordStream() throws IOException { // Patch actual length back in int length = count - 4; TlsUtils.checkUint24(length); TlsUtils.writeUint24(length, buf, 1); writeHandshakeMessage(buf, 0, count); buf = null; } }
/** * Encode this {@link Certificate} to an {@link OutputStream}. * * @param output the {@link OutputStream} to encode to. * @throws IOException */ public void encode(OutputStream output) throws IOException { Vector derEncodings = new Vector(this.certificateList.length); int totalLength = 0; for (int i = 0; i < this.certificateList.length; ++i) { byte[] derEncoding = certificateList[i].getEncoded(ASN1Encoding.DER); derEncodings.addElement(derEncoding); totalLength += derEncoding.length + 3; } TlsUtils.checkUint24(totalLength); TlsUtils.writeUint24(totalLength, output); for (int i = 0; i < derEncodings.size(); ++i) { byte[] derEncoding = (byte[])derEncodings.elementAt(i); TlsUtils.writeOpaque24(derEncoding, output); } }
/** * Encode this {@link Certificate} to an {@link OutputStream}. * * @param output the {@link OutputStream} to encode to. * @throws IOException */ public void encode(OutputStream output) throws IOException { Vector derEncodings = new Vector(this.certificateList.length); int totalLength = 0; for (int i = 0; i < this.certificateList.length; ++i) { byte[] derEncoding = certificateList[i].getEncoded(ASN1Encoding.DER); derEncodings.addElement(derEncoding); totalLength += derEncoding.length + 3; } TlsUtils.checkUint24(totalLength); TlsUtils.writeUint24(totalLength, output); for (int i = 0; i < derEncodings.size(); ++i) { byte[] derEncoding = (byte[])derEncodings.elementAt(i); TlsUtils.writeOpaque24(derEncoding, output); } }
void sendMessage(short msg_type, byte[] body) throws IOException { TlsUtils.checkUint24(body.length); if (!sending) { checkInboundFlight(); sending = true; outboundFlight.removeAllElements(); } Message message = new Message(message_seq++, msg_type, body); outboundFlight.addElement(message); writeMessage(message); updateHandshakeMessagesDigest(message); }
void sendMessage(short msg_type, byte[] body) throws IOException { TlsUtils.checkUint24(body.length); if (!sending) { checkInboundFlight(); sending = true; outboundFlight.removeAllElements(); } Message message = new Message(message_seq++, msg_type, body); outboundFlight.addElement(message); writeMessage(message); updateHandshakeMessagesDigest(message); }