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;
|
|
|
|
|
2023-04-14 15:13:43 +02:00
|
|
|
case "encrypt":
|
|
|
|
return EncryptImpl.SUPPORTED_PROFILES;
|
|
|
|
|
2023-04-14 14:31:48 +02:00
|
|
|
default:
|
|
|
|
throw new SOPGPException.UnsupportedProfile(command);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|