code: public String signDataWithBase64(byte[] data)
              throws InvalidKeyException, NoSuchAlgorithmException, NoSuchProviderException, SignatureException {
          String res = null;
          byte[] signature = this.signData(data);
          // to base64
          res = Base64.toBase64String(signature);
          return res;
      }
docs: Generate the signature with the enrollment private key
  
  @param data
  data to sign
  @return the signature in base64
  @throws SignatureException
  SignatureException
  @throws NoSuchProviderException
  NoSuchProviderException
  @throws NoSuchAlgorithmException
  NoSuchAlgorithmException
  @throws InvalidKeyException
  InvalidKeyException