@@ -0,0 +1,2542 @@
+package cz.hobrasoft.pdfmu.operation.signature;%0D%0A%0D%0Aimport com.itextpdf.text.pdf.security.TSAClient;%0D%0Aimport com.itextpdf.text.pdf.security.TSAClientBouncyCastle;%0D%0Aimport cz.hobrasoft.pdfmu.operation.args.ArgsConfiguration;%0D%0Aimport cz.hobrasoft.pdfmu.operation.args.PasswordArgs;%0D%0Aimport net.sourceforge.argparse4j.inf.ArgumentGroup;%0D%0Aimport net.sourceforge.argparse4j.inf.ArgumentParser;%0D%0Aimport net.sourceforge.argparse4j.inf.Namespace;%0D%0A%0D%0A/**%0D%0A * Parameters of timestamping process.%0D%0A *%0D%0A * @author %3Ca href=%22mailto:filip.bartek@hobrasoft.cz%22%3EFilip Bartek%3C/a%3E%0D%0A */%0D%0Apublic class TimestampParameters implements ArgsConfiguration %7B%0D%0A%0D%0A    /**%0D%0A     * Timestamp authority URL.%0D%0A     */%0D%0A    public String url;%0D%0A%0D%0A    /**%0D%0A     * Timestamp authority login username.%0D%0A     */%0D%0A    public String username;%0D%0A%0D%0A    /**%0D%0A     * Timestamp authority login password.%0D%0A     */%0D%0A    public String password;%0D%0A%0D%0A    private final PasswordArgs passwordArgs = new PasswordArgs(%22timestamp authority password%22,%0D%0A            null,%0D%0A            %22tsa-password%22,%0D%0A            %22timestamp authority password (default: %3Cnone%3E)%22,%0D%0A            null,%0D%0A            %22tsa-password-envvar%22,%0D%0A            %22timestamp authority password environment variable%22,%0D%0A            %22PDFMU_TSA_PASSWORD%22);%0D%0A%0D%0A    @Override%0D%0A    public void addArguments(ArgumentParser parser) %7B%0D%0A        ArgumentGroup group = parser.addArgumentGroup(%22timestamp%22);%0D%0A        // TODO: Add description%0D%0A%0D%0A        group.addArgument(%22--tsa-url%22)%0D%0A                .help(%22timestamp authority URL (set to enable timestamp)%22)%0D%0A                .type(String.class);%0D%0A%0D%0A        group.addArgument(%22--tsa-username%22)%0D%0A                .help(%22timestamp authority username (set to enable TSA authorization)%22)%0D%0A                .type(String.class);%0D%0A%0D%0A        // TODO: Include the password options in %60group%60%0D%0A        passwordArgs.addArguments(parser);%0D%0A    %7D%0D%0A%0D%0A    @Override%0D%0A    public void setFromNamespace(Namespace namespace) %7B%0D%0A        url = namespace.get(%22tsa_url%22);%0D%0A        username = namespace.getString(%22tsa_username%22);%0D%0A%0D%0A        // Set password%0D%0A        passwordArgs.setFromNamespace(namespace);%0D%0A        password = passwordArgs.getPassword();%0D%0A    %7D%0D%0A%0D%0A    /**%0D%0A     * Returns the %7B@link TSAClient%7D that corresponds to these parameters.%0D%0A     *%0D%0A     * @return null if the timestamp authority has not been configured%0D%0A     */%0D%0A    public TSAClient getTSAClient() %7B%0D%0A        if (url == null) %7B%0D%0A            return null;%0D%0A        %7D%0D%0A        return new TSAClientBouncyCastle(url, username, password);%0D%0A    %7D%0D%0A%0D%0A%7D%0D%0A

Add class TimestampParameters