001// SPDX-FileCopyrightText: 2021 Paul Schaub <vanitasvitae@fsfe.org>
002//
003// SPDX-License-Identifier: Apache-2.0
004
005package sop;
006
007import sop.operation.Armor;
008import sop.operation.Dearmor;
009import sop.operation.Decrypt;
010import sop.operation.DetachInbandSignatureAndMessage;
011import sop.operation.Encrypt;
012import sop.operation.ExtractCert;
013import sop.operation.GenerateKey;
014import sop.operation.Sign;
015import sop.operation.Verify;
016import sop.operation.Version;
017
018/**
019 * Stateless OpenPGP Interface.
020 */
021public interface SOP {
022
023    /**
024     * Get information about the implementations name and version.
025     *
026     * @return version
027     */
028    Version version();
029
030    /**
031     * Generate a secret key.
032     * Customize the operation using the builder {@link GenerateKey}.
033     *
034     * @return builder instance
035     */
036    GenerateKey generateKey();
037
038    /**
039     * Extract a certificate (public key) from a secret key.
040     * Customize the operation using the builder {@link ExtractCert}.
041     *
042     * @return builder instance
043     */
044    ExtractCert extractCert();
045
046    /**
047     * Create detached signatures.
048     * Customize the operation using the builder {@link Sign}.
049     *
050     * @return builder instance
051     */
052    Sign sign();
053
054    /**
055     * Verify detached signatures.
056     * Customize the operation using the builder {@link Verify}.
057     *
058     * @return builder instance
059     */
060    Verify verify();
061
062    /**
063     * Encrypt a message.
064     * Customize the operation using the builder {@link Encrypt}.
065     *
066     * @return builder instance
067     */
068    Encrypt encrypt();
069
070    /**
071     * Decrypt a message.
072     * Customize the operation using the builder {@link Decrypt}.
073     *
074     * @return builder instance
075     */
076    Decrypt decrypt();
077
078    /**
079     * Convert binary OpenPGP data to ASCII.
080     * Customize the operation using the builder {@link Armor}.
081     *
082     * @return builder instance
083     */
084    Armor armor();
085
086    /**
087     * Converts ASCII armored OpenPGP data to binary.
088     * Customize the operation using the builder {@link Dearmor}.
089     *
090     * @return builder instance
091     */
092    Dearmor dearmor();
093
094    DetachInbandSignatureAndMessage detachInbandSignatureAndMessage();
095}