@Override protected CertificateRequestMessage createHandshakeMessage() { return new CertificateRequestMessage(); }
private void prepareClientCertificateTypesCount(CertificateRequestMessage msg) { msg.setClientCertificateTypesCount(msg.getClientCertificateTypes().getValue().length); LOGGER.debug("ClientCertificateTypesCount: " + msg.getClientCertificateTypesCount().getValue()); }
private void prepareDistinguishedNamesLength(CertificateRequestMessage msg) { msg.setDistinguishedNamesLength(msg.getDistinguishedNames().getValue().length); LOGGER.debug("DistinguishedNamesLength: " + msg.getDistinguishedNamesLength().getValue()); }
private void prepareSignatureHashAlgorithmsLength(CertificateRequestMessage msg) { msg.setSignatureHashAlgorithmsLength(msg.getSignatureHashAlgorithms().getValue().length); LOGGER.debug("SignatureHashAlgorithmsLength: " + msg.getSignatureHashAlgorithmsLength().getValue()); }
/** * Reads the next bytes as the ClientCertificateTypes and writes them in the * message * * @param msg * Message to write in */ private void parseClientCertificateTypes(CertificateRequestMessage msg) { msg.setClientCertificateTypes(parseByteArrayField(msg.getClientCertificateTypesCount().getValue())); LOGGER.debug("ClientCertificateTypes: " + Arrays.toString(msg.getClientCertificateTypes().getValue())); }
/** * Reads the next bytes as the DistinguishedNames and writes them in the * message * * @param msg * Message to write in */ private void parseDistinguishedNames(CertificateRequestMessage msg) { msg.setDistinguishedNames(parseByteArrayField(msg.getDistinguishedNamesLength().getValue())); LOGGER.debug("DistinguishedNames: " + ArrayConverter.bytesToHexString(msg.getDistinguishedNames().getValue())); }
/** * Reads the next bytes as the SignatureHashAlgorithms and writes them in * the message * * @param msg * Message to write in */ private void parseSignatureHashAlgorithms(CertificateRequestMessage message) { message.setSignatureHashAlgorithms(parseByteArrayField(message.getSignatureHashAlgorithmsLength().getValue())); LOGGER.debug("SignatureHashAlgorithms: " + ArrayConverter.bytesToHexString(message.getSignatureHashAlgorithms().getValue())); }
private void prepareClientCertificateTypes(byte[] certTypes, CertificateRequestMessage msg) { msg.setClientCertificateTypes(certTypes); LOGGER.debug("ClientCertificateTypes: " + ArrayConverter.bytesToHexString(msg.getClientCertificateTypes().getValue())); }
private void prepareSignatureHashAlgorithms(CertificateRequestMessage msg) { msg.setSignatureHashAlgorithms(sigHashAlgos); LOGGER.debug("SignatureHashAlgorithms: " + ArrayConverter.bytesToHexString(msg.getSignatureHashAlgorithms().getValue())); }
/** * Reads the next bytes as the DistinguishedNamesLength and writes them in * the message * * @param msg * Message to write in */ private void parseDistinguishedNamesLength(CertificateRequestMessage msg) { msg.setDistinguishedNamesLength(parseIntField(HandshakeByteLength.DISTINGUISHED_NAMES_LENGTH)); LOGGER.debug("DistinguishedNamesLength: " + msg.getDistinguishedNamesLength().getValue()); }
/** * Reads the next bytes as the ClientCertificateCount and writes them in the * message * * @param msg * Message to write in */ private void parseClientCertificateTypesCount(CertificateRequestMessage msg) { msg.setClientCertificateTypesCount(parseIntField(HandshakeByteLength.CERTIFICATES_TYPES_COUNT)); LOGGER.debug("ClientCertificateTypesCount: " + msg.getClientCertificateTypesCount().getValue()); }
/** * Reads the next bytes as the SignatureHashAlgorithmsLength and writes them * in the message * * @param msg * Message to write in */ private void parseSignatureHashAlgorithmsLength(CertificateRequestMessage msg) { msg.setSignatureHashAlgorithmsLength(parseIntField(HandshakeByteLength.SIGNATURE_HASH_ALGORITHMS_LENGTH)); LOGGER.debug("SignatureHashAlgorithmsLength: " + msg.getSignatureHashAlgorithmsLength().getValue()); }
private void prepareDistinguishedNames(CertificateRequestMessage msg) { msg.setDistinguishedNames(chooser.getConfig().getDistinguishedNames()); LOGGER.debug("DistinguishedNames: " + ArrayConverter.bytesToHexString(msg.getDistinguishedNames().getValue())); }
/** * Checks if the DistinguishedNamesLength has a value greater than Zero * * @param message * Message to check * @return True if the field has a value greater than Zero */ private boolean hasDistinguishedNamesLength(CertificateRequestMessage msg) { return msg.getDistinguishedNamesLength().getValue() != 0; }
/** * Writes the ClientCertificateType of the CertificateRequestMessage into * the final byte[] */ private void writeClientCertificateTypes(CertificateRequestMessage msg) { appendBytes(msg.getClientCertificateTypes().getValue()); LOGGER.debug("ClientCertificateTypes: " + ArrayConverter.bytesToHexString(msg.getClientCertificateTypes().getValue())); }
private void adjustDistinguishedNames(CertificateRequestMessage message) { if (message.getDistinguishedNames() != null && message.getDistinguishedNames().getValue() != null) { byte[] distinguishedNames = message.getDistinguishedNames().getValue(); tlsContext.setDistinguishedNames(distinguishedNames); LOGGER.debug("Set DistinguishedNames in Context to " + ArrayConverter.bytesToHexString(distinguishedNames, false)); } else { LOGGER.debug("Not adjusting DistinguishedNames"); } }
/** * Writes the SignatureHandshakeAlgorithms of the CertificateRequestMessage * into the final byte[] */ private void writeSignatureHandshakeAlgorithms(CertificateRequestMessage msg) { appendBytes(msg.getSignatureHashAlgorithms().getValue()); LOGGER.debug("SignatureHashAlgorithms: " + ArrayConverter.bytesToHexString(msg.getSignatureHashAlgorithms().getValue())); }
/** * Writes the ClientCertificateTypeCount of the CertificateRequestMessage * into the final byte[] */ private void writeClientCertificateTypesCount(CertificateRequestMessage msg) { appendInt(msg.getClientCertificateTypesCount().getValue(), HandshakeByteLength.CERTIFICATES_TYPES_COUNT); LOGGER.debug("ClientCertificateTypesCount: " + msg.getClientCertificateTypesCount().getValue()); }
/** * Writes the SignatureHandshakeAlgorithmsLength of the * CertificateRequestMessage into the final byte[] */ private void writeSignatureHandshakeAlgorithmsLength(CertificateRequestMessage msg) { appendInt(msg.getSignatureHashAlgorithmsLength().getValue(), HandshakeByteLength.SIGNATURE_HASH_ALGORITHMS_LENGTH); LOGGER.debug("SignatureHashAlgorithmsLength: " + msg.getSignatureHashAlgorithmsLength().getValue()); }
private boolean hasDistinguishedNames(CertificateRequestMessage msg) { return msg.getDistinguishedNamesLength().getValue() != 0; }