This commit is contained in:
Paul Schaub 2022-05-29 21:17:03 +02:00
parent 8184c30617
commit a7f02d58cc
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
18 changed files with 442 additions and 115 deletions

View file

@ -7,10 +7,12 @@ package sop;
import sop.operation.Armor;
import sop.operation.Dearmor;
import sop.operation.Decrypt;
import sop.operation.InlineDetach;
import sop.operation.Encrypt;
import sop.operation.ExtractCert;
import sop.operation.GenerateKey;
import sop.operation.InlineDetach;
import sop.operation.InlineSign;
import sop.operation.InlineVerify;
import sop.operation.Sign;
import sop.operation.Verify;
import sop.operation.Version;
@ -91,5 +93,9 @@ public interface SOP {
*/
Dearmor dearmor();
InlineDetach detachInbandSignatureAndMessage();
InlineDetach inlineDetach();
InlineSign inlineSign();
InlineVerify inlineVerify();
}

View file

@ -49,7 +49,7 @@ public interface AbstractSign<T> {
}
/**
* Provide the decryption password for the secret key.
* Provide the password for the secret key used for signing.
*
* @param password password
* @return builder instance
@ -59,7 +59,7 @@ public interface AbstractSign<T> {
}
/**
* Provide the decryption password for the secret key.
* Provide the password for the secret key used for signing.
*
* @param password password
* @return builder instance

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.Ready;
import sop.enums.EncryptAs;
@ -68,6 +69,24 @@ public interface Encrypt {
return signWith(new ByteArrayInputStream(key));
}
/**
* Provide the password for the secret key used for signing.
*
* @param password password
* @return builder instance
*/
default Encrypt withKeyPassword(String password) {
return withKeyPassword(password.getBytes(Charset.forName("UTF8")));
}
/**
* Provide the password for the secret key used for sigining.
*
* @param password password
* @return builder instance
*/
Encrypt withKeyPassword(byte[] password);
/**
* Encrypt with the given password.
*