ByteArrayOutputStream baos = new ByteArrayOutputStream();
PGPSigner signer = configuration.getSigner();
PGPPublicKey publicKey = signer.getSecretKey().getPublicKey();
BCPGOutputStream out = new BCPGOutputStream(new ArmoredOutputStream(baos));
publicKey.encode(out);
out.close();
baos.close();
return baos.toByteArray();