diff --git a/sop-java/src/main/java/sop/operation/InlineSign.java b/sop-java/src/main/java/sop/operation/InlineSign.java new file mode 100644 index 0000000..ed1f90b --- /dev/null +++ b/sop-java/src/main/java/sop/operation/InlineSign.java @@ -0,0 +1,9 @@ +// SPDX-FileCopyrightText: 2022 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + +package sop.operation; + +public interface InlineSign { + +} diff --git a/sop-java/src/main/java/sop/operation/Sign.java b/sop-java/src/main/java/sop/operation/Sign.java index 931c80a..f02e709 100644 --- a/sop-java/src/main/java/sop/operation/Sign.java +++ b/sop-java/src/main/java/sop/operation/Sign.java @@ -46,6 +46,20 @@ public interface Sign { */ Sign key(InputStream key) throws SOPGPException.KeyIsProtected, SOPGPException.BadData, IOException; + /** + * Add one or more signing keys. + * + * @param key byte array containing encoded keys + * @return builder instance + * + * @throws sop.exception.SOPGPException.KeyIsProtected if the key is password protected + * @throws sop.exception.SOPGPException.BadData if the byte array does not contain an OpenPGP key + * @throws IOException in case of an IO error + */ + default Sign key(byte[] key) throws SOPGPException.KeyIsProtected, SOPGPException.BadData, IOException { + return key(new ByteArrayInputStream(key)); + } + /** * Provide the decryption password for the secret key. * @@ -64,20 +78,6 @@ public interface Sign { */ Sign withKeyPassword(byte[] password); - /** - * Add one or more signing keys. - * - * @param key byte array containing encoded keys - * @return builder instance - * - * @throws sop.exception.SOPGPException.KeyIsProtected if the key is password protected - * @throws sop.exception.SOPGPException.BadData if the byte array does not contain an OpenPGP key - * @throws IOException in case of an IO error - */ - default Sign key(byte[] key) throws SOPGPException.KeyIsProtected, SOPGPException.BadData, IOException { - return key(new ByteArrayInputStream(key)); - } - /** * Signs data. *