pgpainless/pgpainless-sop/src/main/java/org/pgpainless/sop/ListProfilesImpl.java

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
841 B
Java
Raw Normal View History

2023-04-14 14:31:48 +02:00
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package org.pgpainless.sop;
import java.util.List;
import sop.Profile;
import sop.exception.SOPGPException;
import sop.operation.ListProfiles;
2023-11-15 13:39:26 +01:00
import javax.annotation.Nonnull;
2023-05-16 16:49:50 +02:00
/**
* Implementation of the <pre>list-profiles</pre> operation using PGPainless.
*
*/
2023-04-14 14:31:48 +02:00
public class ListProfilesImpl implements ListProfiles {
@Override
2023-11-15 13:39:26 +01:00
@Nonnull
public List<Profile> subcommand(@Nonnull String command) {
2023-04-14 14:31:48 +02:00
switch (command) {
case "generate-key":
return GenerateKeyImpl.SUPPORTED_PROFILES;
case "encrypt":
return EncryptImpl.SUPPORTED_PROFILES;
2023-04-14 14:31:48 +02:00
default:
throw new SOPGPException.UnsupportedProfile(command);
}
}
}