https://github.com/bcgit/bc-java/blame/bdc97032f09c95c1d78ad71e19b6cc2ae712fa99/pkix/src/main/java/org/bouncycastle/pkix/util/X509CertificateFormatter.java#L261 This line should append `pad` instead of `spaces`. `pad` already has the spaces added to it in line 253