Package sop.operation

# Interface GenerateKey

public interface GenerateKey

## Method Summary

Modifier and Type
Method
Description
`Ready`
`generate()`
Generate the OpenPGP key and return it encoded as an `InputStream`.
`GenerateKey`
`noArmor()`
Disable ASCII armor encoding.
`GenerateKey`
`profile(String profile)`
Pass in a profile identifier.
`default GenerateKey`
`profile(Profile profile)`
Pass in a profile.
`GenerateKey`
`signingOnly()`
If this options is set, the generated key will not be capable of encryption / decryption.
`GenerateKey`
`userId(String userId)`
Adds a user-id.
`default GenerateKey`
`withKeyPassword(byte[] password)`
Set a password for the key.
`GenerateKey`
`withKeyPassword(String password)`
Set a password for the key.

## Method Details

### 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 supported
  `SOPGPException.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-readable
  `SOPGPException.UnsupportedOption` - if key passwords are not supported

### profile

default GenerateKey profile(Profile profile)
Pass in a profile.

Parameters:
  `profile` - profile
Returns:
  builder instance

### profile

GenerateKey profile(String profile)
Pass in a profile identifier.

Parameters:
  `profile` - profile identifier
Returns:
  builder instance

### signingOnly

GenerateKey signingOnly()
If this options is set, the generated key will not be capable of encryption / decryption.

Returns:
  builder instance

### generate

Ready generate() throws SOPGPException.MissingArg, SOPGPException.UnsupportedAsymmetricAlgo, IOException
Generate the OpenPGP key and return it encoded as an `InputStream`.

Returns:
  key
Throws:
  `SOPGPException.MissingArg` - if no user-id was provided
  `SOPGPException.UnsupportedAsymmetricAlgo` - if the generated key uses an unsupported asymmetric algorithm
  `IOException` - in case of an IO error