1

We are using Openkeychain to encrypt and decrypt emails for our android mail client. We want the OpenPGP block data to look more professional. How can we add the version line in the keyblock as mentioned below? Many OpenPGP encrypters use this, and would be great we can do this, too.

-----BEGIN PGP MESSAGE-----
Version: openkeychain <-- **Add this line**.

owEBTQGy/pANAwACARsm2bqGdVliAcsdYgBUavgLVGVzdCBmb3IgU3RhY2tPdmVy
ZmxvdyCJARwEAAECAAYFAlRq+AsACgkQGybZuoZ1WWKlVgf/cfsU/aJYnNIimAwq
DKKfWox9c7rEC5ug6qcQzb5YFPsGuyMtZ1Tx9SwCmvU7IXtlnK/BY6H4ut50zOzl
8O8fYaaK63NupeEThlNK1fMvTmt56GLRSgGZ9yBOdkaC3A3SWBAsniPoj5wjBr7m
/MHnqs5Gw1Mtp8I8issZzTQXGjq4j6mAli1Vb3lBpESuF/s/uOxY8jSCV8SDH0UU
RxKoVnzqXd7mD2Dv+KE8K1PKVbVNyT+vIc+rOsRKkaW+6rSXVXie4DWkKxCP5RPe
3Ma3KMark71EwNW86IWryFm8YkP4vt31HKMwW4HUb6nhFF24IQOPle51YoiyZWUC
ejtY4Q==
=xKTQ

-----END PGP MESSAGE-----
Jens Erat
  • 37,523
  • 16
  • 80
  • 96

1 Answers1

1

You're looking for the setVersionHeader(String versionHeader) method in PgpSignEncryptData (there is a corresponding getVersionheader method). Be aware that this is plaintext metadata only available in ASCII-armored output.

PgpSignEncryptData pgpData = new PgpSignEncryptData();
pgpData.setEnableAsciiArmorOutput(asciiArmor)
       .setVersionHeader("Version: openkeychain")
       [...]
Jens Erat
  • 37,523
  • 16
  • 80
  • 96