mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2025-09-09 02:09:42 +02:00
Initial implementation of 'revoke-key' command
This commit is contained in:
parent
ab2e4aa8e7
commit
e6393b44b9
8 changed files with 151 additions and 0 deletions
|
@ -16,6 +16,7 @@ import sop.operation.InlineVerify;
|
|||
import sop.operation.DetachedSign;
|
||||
import sop.operation.DetachedVerify;
|
||||
import sop.operation.ListProfiles;
|
||||
import sop.operation.RevokeKey;
|
||||
import sop.operation.Version;
|
||||
|
||||
/**
|
||||
|
@ -158,4 +159,11 @@ public interface SOP {
|
|||
* @return builder instance
|
||||
*/
|
||||
ListProfiles listProfiles();
|
||||
|
||||
/**
|
||||
* Revoke one or more secret keys.
|
||||
*
|
||||
* @return builder instance
|
||||
*/
|
||||
RevokeKey revokeKey();
|
||||
}
|
||||
|
|
49
sop-java/src/main/java/sop/operation/RevokeKey.java
Normal file
49
sop-java/src/main/java/sop/operation/RevokeKey.java
Normal file
|
@ -0,0 +1,49 @@
|
|||
// SPDX-FileCopyrightText: 2021 Paul Schaub <vanitasvitae@fsfe.org>
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package sop.operation;
|
||||
|
||||
import sop.Ready;
|
||||
import sop.exception.SOPGPException;
|
||||
import sop.util.UTF8Util;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
public interface RevokeKey {
|
||||
|
||||
/**
|
||||
* Disable ASCII armor encoding.
|
||||
*
|
||||
* @return builder instance
|
||||
*/
|
||||
RevokeKey noArmor();
|
||||
|
||||
/**
|
||||
* Provide the decryption password for the secret key.
|
||||
*
|
||||
* @param password password
|
||||
* @return builder instance
|
||||
* @throws SOPGPException.UnsupportedOption if the implementation does not support key passwords
|
||||
* @throws SOPGPException.PasswordNotHumanReadable if the password is not human-readable
|
||||
*/
|
||||
default RevokeKey withKeyPassword(String password)
|
||||
throws SOPGPException.UnsupportedOption,
|
||||
SOPGPException.PasswordNotHumanReadable {
|
||||
return withKeyPassword(password.getBytes(UTF8Util.UTF8));
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide the decryption password for the secret key.
|
||||
*
|
||||
* @param password password
|
||||
* @return builder instance
|
||||
* @throws SOPGPException.UnsupportedOption if the implementation does not support key passwords
|
||||
* @throws SOPGPException.PasswordNotHumanReadable if the password is not human-readable
|
||||
*/
|
||||
RevokeKey withKeyPassword(byte[] password)
|
||||
throws SOPGPException.UnsupportedOption,
|
||||
SOPGPException.PasswordNotHumanReadable;
|
||||
|
||||
Ready keys(InputStream keys);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue