@Test
public void testValidateCertReqPublicKeyWhitespace() throws IOException {

    Path path = Paths.get("src/test/resources/valid.csr");
    String csr = new String(Files.readAllBytes(path));
    
    X509CertRequest certReq = new X509CertRequest(csr);
    assertNotNull(certReq);
    
    final String ztsPublicKey1 = "   -----BEGIN PUBLIC KEY-----\n"
            + "MFwwDQYJKoZIhvcNA QEBBQADSwAwSAJBAKrvfvBgXWqW Aorw5hYJu3dpOJe0gp3n\n\r\r\n"
            + "TgiiPGT7+jzm6BRcssOBTPFIMkePT2a8Tq+FYSmFnHfbQjwmYw2uMK8CAwEAAQ==\n\r"
            + "-----END PUBLIC KEY-----  \n";
    final String ztsPublicKey2 = "-----BEGIN PUBLIC KEY-----"
            + "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKrvfvBgXWqWAorw5hYJu3dpOJe0gp3n"
            + "TgiiPGT7+jzm6BRcssOBTPFIMkePT2a8Tq+FYSmFnHfbQjwmYw2uMK8CAwEAAQ=="
            + "-----END PUBLIC KEY-----";
    
    assertTrue(certReq.validatePublicKeys(ztsPublicKey1));
    assertTrue(certReq.validatePublicKeys(ztsPublicKey2));
}