diff --git a/sop-java/src/main/java/sop/operation/Sign.java b/sop-java/src/main/java/sop/operation/Sign.java index 189337d..931c80a 100644 --- a/sop-java/src/main/java/sop/operation/Sign.java +++ b/sop-java/src/main/java/sop/operation/Sign.java @@ -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. *