Package sop.operation
Interface AbstractSign<T>
-
- All Known Subinterfaces:
DetachedSign
,InlineSign
public interface AbstractSign<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default T
key(byte[] key)
Add one or more signing keys.T
key(InputStream key)
Add one or more signing keys.T
noArmor()
Disable ASCII armor encoding.T
withKeyPassword(byte[] password)
Provide the password for the secret key used for signing.default T
withKeyPassword(String password)
Provide the password for the secret key used for signing.
-
-
-
Method Detail
-
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 theInputStream
does 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
-
-