private byte[] convertClientCertificateTypes(List<ClientCertificateType> typeList) { ByteArrayOutputStream stream = new ByteArrayOutputStream(); for (ClientCertificateType type : typeList) { try { stream.write(type.getArrayValue()); } catch (IOException ex) { throw new PreparationException( "Could not prepare CertificateRequestMessage. Failed to write ClientCertificateType into message", ex); } } return stream.toByteArray(); }
private List<ClientCertificateType> convertClientCertificateTypes(byte[] bytesToConvert) { List<ClientCertificateType> list = new LinkedList<>(); for (byte b : bytesToConvert) { ClientCertificateType type = ClientCertificateType.getClientCertificateType(b); if (type == null) { LOGGER.warn("Cannot convert:" + b + " to a ClientCertificateType"); } else { list.add(type); } } return list; }
if (clientCertificateTypes != null && clientCertificateTypes.getValue() != null) { for (int i = 0; i < clientCertificateTypes.getValue().length; i++) { sb.append(ClientCertificateType.getClientCertificateType(clientCertificateTypes.getValue()[i])).append( ", ");