code: @Override
     public void configureVisualSignature(PdfSignatureAppearance psa)
         throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException, VectorPrintException {
        psa.setReason("verify origin");
        try {
           psa.setLocation(InetAddress.getLocalHost().getHostName());
        } catch (UnknownHostException ex) {
           log.log(Level.WARNING, "unable to set location for pdf signature", ex);
        }
  
        char[] pw = getValue(KEYSTORE_PASSWORD, char[].class);
        char[] clone = pw.clone();
        KeyStore ks = loadKeyStore(pw);
  
        PrivateKey key = getKey(ks, (String) ks.aliases().nextElement(), clone);
        Certificate[] certificateChain = ks.getCertificateChain((String) ks.aliases().nextElement());
  
        PrivateKeySignature pks = new PrivateKeySignature(key, getValue(DIGESTPARAM, DIGESTALGORITHM.class).name(), "BC");
        ExternalDigest as = new BouncyCastleDigest();
  
        psa.setVisibleSignature(new Rectangle(0, getHeight() - 100, 200, getHeight()), 1, "signature");
        try {
           MakeSignature.signDetached(psa, as, pks, certificateChain, null, null, null, 0, MakeSignature.CryptoStandard.CMS);
        } catch (IOException | DocumentException | GeneralSecurityException ex) {
           throw new VectorPrintException(ex);
        }
     }
docs: adds a visible signature of 200 / 100 at top left of the first page of the pdf with "verify origin" as reason, the
  localhost name as location. Uses MakeSignature.signDetached(psa, as, pks, certificateChain, null, null, null, 0,
  MakeSignature.CryptoStandard.CMS)
  
  @see #loadKeyStore(char[])
  @see #getKey(java.security.KeyStore, java.lang.String, char[]) }
  @param psa
  @throws KeyStoreException
  @throws NoSuchAlgorithmException
  @throws UnrecoverableKeyException
  @throws VectorPrintException