Package sop.operation
Interface AbstractSign<T>
- All Known Subinterfaces:
DetachedSign,InlineSign
public interface AbstractSign<T>
-
Method Summary
Modifier and TypeMethodDescriptiondefault Tkey(byte[] key) Add one or more signing keys.key(InputStream key) Add one or more signing keys.noArmor()Disable ASCII armor encoding.withKeyPassword(byte[] password) Provide the password for the secret key used for signing.default TwithKeyPassword(String password) Provide the password for the secret key used for signing.
-
Method Details
-
noArmor
T noArmor()Disable ASCII armor encoding.- Returns:
- builder instance
-
key
T key(InputStream key) throws SOPGPException.KeyCannotSign, SOPGPException.BadData, SOPGPException.UnsupportedAsymmetricAlgo, IOException Add one or more signing keys.- Parameters:
key- input stream containing encoded keys- Returns:
- builder instance
- Throws:
SOPGPException.KeyCannotSign- if the key cannot be used for signingSOPGPException.BadData- if theInputStreamdoes not contain an OpenPGP keySOPGPException.UnsupportedAsymmetricAlgo- if the key uses an unsupported asymmetric algorithmIOException- in case of an IO error
-
key
default T key(byte[] key) throws SOPGPException.KeyCannotSign, SOPGPException.BadData, SOPGPException.UnsupportedAsymmetricAlgo, IOException Add one or more signing keys.- Parameters:
key- byte array containing encoded keys- Returns:
- builder instance
- Throws:
SOPGPException.KeyCannotSign- if the key cannot be used for signingSOPGPException.BadData- if the byte array does not contain an OpenPGP keySOPGPException.UnsupportedAsymmetricAlgo- if the key uses an unsupported asymmetric algorithmIOException- in case of an IO error
-
withKeyPassword
default T withKeyPassword(String password) throws SOPGPException.UnsupportedOption, SOPGPException.PasswordNotHumanReadable Provide the password for the secret key used for signing.- Parameters:
password- password- Returns:
- builder instance
- Throws:
SOPGPException.UnsupportedOption- if key passwords are not supportedSOPGPException.PasswordNotHumanReadable- if the provided passphrase is not human-readable
-
withKeyPassword
T withKeyPassword(byte[] password) throws SOPGPException.UnsupportedOption, SOPGPException.PasswordNotHumanReadable Provide the password for the secret key used for signing.- Parameters:
password- password- Returns:
- builder instance
- Throws:
SOPGPException.UnsupportedOption- if key passwords are not supportedSOPGPException.PasswordNotHumanReadable- if the provided passphrase is not human-readable
-