Package sop.operation
Interface GenerateKey
-
public interface GenerateKey
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Readygenerate()Generate the OpenPGP key and return it encoded as anInputStream.GenerateKeynoArmor()Disable ASCII armor encoding.GenerateKeyuserId(String userId)Adds a user-id.default GenerateKeywithKeyPassword(byte[] password)Set a password for the key.GenerateKeywithKeyPassword(String password)Set a password for the key.
-
-
-
Method Detail
-
noArmor
GenerateKey noArmor()
Disable ASCII armor encoding.- Returns:
- builder instance
-
userId
GenerateKey userId(String userId)
Adds a user-id.- Parameters:
userId- user-id- Returns:
- builder instance
-
withKeyPassword
GenerateKey withKeyPassword(String password) throws SOPGPException.PasswordNotHumanReadable, SOPGPException.UnsupportedOption
Set a password for the key.- Parameters:
password- password to protect the key- Returns:
- builder instance
- Throws:
SOPGPException.UnsupportedOption- if key passwords are not supportedSOPGPException.PasswordNotHumanReadable- if the password is not human-readable
-
withKeyPassword
default GenerateKey withKeyPassword(byte[] password) throws SOPGPException.PasswordNotHumanReadable, SOPGPException.UnsupportedOption
Set a password for the key.- Parameters:
password- password to protect the key- Returns:
- builder instance
- Throws:
SOPGPException.PasswordNotHumanReadable- if the password is not human-readableSOPGPException.UnsupportedOption- if key passwords are not supported
-
generate
Ready generate() throws SOPGPException.MissingArg, SOPGPException.UnsupportedAsymmetricAlgo, IOException
Generate the OpenPGP key and return it encoded as anInputStream.- Returns:
- key
- Throws:
SOPGPException.MissingArg- if no user-id was providedSOPGPException.UnsupportedAsymmetricAlgo- if the generated key uses an unsupported asymmetric algorithmIOException- in case of an IO error
-
-