001// SPDX-FileCopyrightText: 2021 Paul Schaub <vanitasvitae@fsfe.org>
002//
003// SPDX-License-Identifier: Apache-2.0
004
005package sop.operation;
006
007import java.io.IOException;
008import java.io.InputStream;
009
010import sop.Ready;
011import sop.exception.SOPGPException;
012
013public interface GenerateKey {
014
015    /**
016     * Disable ASCII armor encoding.
017     *
018     * @return builder instance
019     */
020    GenerateKey noArmor();
021
022    /**
023     * Adds a user-id.
024     *
025     * @param userId user-id
026     * @return builder instance
027     */
028    GenerateKey userId(String userId);
029
030    /**
031     * Generate the OpenPGP key and return it encoded as an {@link InputStream}.
032     *
033     * @return key
034     */
035    Ready generate() throws SOPGPException.MissingArg, SOPGPException.UnsupportedAsymmetricAlgo, IOException;
036}