mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-12-22 12:57:57 +01:00
Add withKeypassword() methods to Decrypt
This commit is contained in:
parent
0699ae740a
commit
0bfc12c1e1
1 changed files with 24 additions and 5 deletions
|
@ -4,16 +4,17 @@
|
|||
|
||||
package sop.operation;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Date;
|
||||
|
||||
import sop.DecryptionResult;
|
||||
import sop.ReadyWithResult;
|
||||
import sop.SessionKey;
|
||||
import sop.exception.SOPGPException;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.Date;
|
||||
|
||||
public interface Decrypt {
|
||||
|
||||
/**
|
||||
|
@ -121,6 +122,24 @@ public interface Decrypt {
|
|||
return withKey(new ByteArrayInputStream(key));
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide the decryption password for the secret key.
|
||||
*
|
||||
* @param password password
|
||||
* @return builder instance
|
||||
*/
|
||||
default Decrypt withKeyPassword(String password) {
|
||||
return withKeyPassword(password.getBytes(Charset.forName("UTF8")));
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide the decryption password for the secret key.
|
||||
*
|
||||
* @param password password
|
||||
* @return builder instance
|
||||
*/
|
||||
Decrypt withKeyPassword(byte[] password);
|
||||
|
||||
/**
|
||||
* Decrypts the given ciphertext, returning verification results and plaintext.
|
||||
* @param ciphertext ciphertext
|
||||
|
|
Loading…
Reference in a new issue