Add withKeyPassword() methods to Sign

This commit is contained in:
Paul Schaub 2022-05-24 21:18:37 +02:00
parent 146a2bd761
commit 0699ae740a
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
1 changed files with 19 additions and 0 deletions

View File

@ -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.
*