mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-12-22 12:57:57 +01:00
Move withKeyPassword method in Sign around
This commit is contained in:
parent
72c3b3218d
commit
e8d7d1b5f4
2 changed files with 23 additions and 14 deletions
9
sop-java/src/main/java/sop/operation/InlineSign.java
Normal file
9
sop-java/src/main/java/sop/operation/InlineSign.java
Normal file
|
@ -0,0 +1,9 @@
|
|||
// SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package sop.operation;
|
||||
|
||||
public interface InlineSign {
|
||||
|
||||
}
|
|
@ -46,6 +46,20 @@ public interface Sign {
|
|||
*/
|
||||
Sign key(InputStream key) throws SOPGPException.KeyIsProtected, SOPGPException.BadData, IOException;
|
||||
|
||||
/**
|
||||
* Add one or more signing keys.
|
||||
*
|
||||
* @param key byte array containing encoded keys
|
||||
* @return builder instance
|
||||
*
|
||||
* @throws sop.exception.SOPGPException.KeyIsProtected if the key is password protected
|
||||
* @throws sop.exception.SOPGPException.BadData if the byte array does not contain an OpenPGP key
|
||||
* @throws IOException in case of an IO error
|
||||
*/
|
||||
default Sign key(byte[] key) throws SOPGPException.KeyIsProtected, SOPGPException.BadData, IOException {
|
||||
return key(new ByteArrayInputStream(key));
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide the decryption password for the secret key.
|
||||
*
|
||||
|
@ -64,20 +78,6 @@ public interface Sign {
|
|||
*/
|
||||
Sign withKeyPassword(byte[] password);
|
||||
|
||||
/**
|
||||
* Add one or more signing keys.
|
||||
*
|
||||
* @param key byte array containing encoded keys
|
||||
* @return builder instance
|
||||
*
|
||||
* @throws sop.exception.SOPGPException.KeyIsProtected if the key is password protected
|
||||
* @throws sop.exception.SOPGPException.BadData if the byte array does not contain an OpenPGP key
|
||||
* @throws IOException in case of an IO error
|
||||
*/
|
||||
default Sign key(byte[] key) throws SOPGPException.KeyIsProtected, SOPGPException.BadData, IOException {
|
||||
return key(new ByteArrayInputStream(key));
|
||||
}
|
||||
|
||||
/**
|
||||
* Signs data.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue