@Override
    public void serialize(final X509CertificateCredential value,
                          final JsonGenerator generator, final SerializerProvider serializers)
        throws IOException {

        if (serializers.getAttribute("WithType") != null) {
            generator.writeArrayFieldStart("certificates");
        }
        Arrays.stream(value.getCertificates()).forEach(Unchecked.consumer(c -> generator.writeBinary(c.getEncoded())));
        if (serializers.getAttribute("WithType") != null) {
            generator.writeEndArray();
        }
    }
This is {@link X509CertificateCredentialJsonSerializer}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-x509-core/src/main/java/org/apereo/cas/adaptors/x509/util/X509CertificateCredentialJsonSerializer.java