mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-11-29 18:42:08 +01:00
Add withKeyPassword() methods to Sign
This commit is contained in:
parent
146a2bd761
commit
0699ae740a
1 changed files with 19 additions and 0 deletions
|
@ -7,6 +7,7 @@ package sop.operation;
|
|||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
import sop.ReadyWithResult;
|
||||
import sop.SigningResult;
|
||||
|
@ -45,6 +46,24 @@ public interface Sign {
|
|||
*/
|
||||
Sign key(InputStream key) throws SOPGPException.KeyIsProtected, SOPGPException.BadData, IOException;
|
||||
|
||||
/**
|
||||
* Provide the decryption password for the secret key.
|
||||
*
|
||||
* @param password password
|
||||
* @return builder instance
|
||||
*/
|
||||
default Sign withKeyPassword(String password) {
|
||||
return withKeyPassword(password.getBytes(Charset.forName("UTF8")));
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide the decryption password for the secret key.
|
||||
*
|
||||
* @param password password
|
||||
* @return builder instance
|
||||
*/
|
||||
Sign withKeyPassword(byte[] password);
|
||||
|
||||
/**
|
||||
* Add one or more signing keys.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue