/** * Reads the next bytes as the requestContextBytes and writes them in the * message * * @param msg * Message to write in */ private void parseRequestContextBytes(CertificateMessage msg) { msg.setRequestContext(parseByteArrayField(msg.getRequestContextLength().getValue())); LOGGER.debug("RequestContextBytes: " + ArrayConverter.bytesToHexString(msg.getRequestContext())); }
/** * Writes the RequestContext of the CertificateMessage into the final byte[] */ private void writeRequestContext(CertificateMessage msg) { appendBytes(msg.getRequestContext().getValue()); LOGGER.debug("RequestContext: " + ArrayConverter.bytesToHexString(msg.getRequestContext().getValue())); }
private void prepareRequestContextLength(CertificateMessage msg) { msg.setRequestContextLength(msg.getRequestContext().getValue().length); LOGGER.debug("RequestContextLength: " + msg.getRequestContextLength().getValue()); byte[] encodedCert = CertificateByteChooser.getInstance().chooseCertificateKeyPair(chooser) .getCertificateBytes(); msg.setCertificatesListBytes(encodedCert); msg.setCertificatesListLength(msg.getCertificatesListBytes().getValue().length); } }
private void prepareRequestContext(CertificateMessage msg) { if (chooser.getConnectionEndType() == ConnectionEndType.CLIENT) { msg.setRequestContext(chooser.getCertificateRequestContext()); } else { msg.setRequestContext(new byte[0]); } LOGGER.debug("RequestContext: " + ArrayConverter.bytesToHexString(msg.getRequestContext().getValue())); }