Document update key

This commit is contained in:
Paul Schaub 2025-04-10 14:36:49 +02:00
parent 8c077a9c13
commit dea7e905a9
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -19,25 +19,61 @@ interface UpdateKey {
*/
fun noArmor(): UpdateKey
/**
* Allow key to be used for signing only.
* If this option is not present, the operation may add a new, encryption-capable component key.
*/
@Throws(SOPGPException.UnsupportedOption::class) fun signingOnly(): UpdateKey
/**
* Do not allow adding new capabilities to the key.
* If this option is not present, the operation may add support for new capabilities to the key.
*/
@Throws(SOPGPException.UnsupportedOption::class) fun noAddedCapabilities(): UpdateKey
/**
* Provide a passphrase for unlocking the secret key.
*
* @param password password
*/
@Throws(SOPGPException.PasswordNotHumanReadable::class, SOPGPException.UnsupportedOption::class)
fun withKeyPassword(password: String): UpdateKey =
withKeyPassword(password.toByteArray(UTF8Util.UTF8))
/**
* Provide a passphrase for unlocking the secret key.
*
* @param password password
*/
@Throws(SOPGPException.PasswordNotHumanReadable::class, SOPGPException.UnsupportedOption::class)
fun withKeyPassword(password: ByteArray): UpdateKey
/**
* Provide certificates that might contain updated signatures or third-party certifications.
* These certificates will be merged into the key.
*
* @param certs input stream of certificates
*/
@Throws(
SOPGPException.UnsupportedOption::class, SOPGPException.BadData::class, IOException::class)
fun mergeCerts(certs: InputStream): UpdateKey
/**
* Provide certificates that might contain updated signatures or third-party certifications.
* These certificates will be merged into the key.
*
* @param certs binary certificates
*/
@Throws(
SOPGPException.UnsupportedOption::class, SOPGPException.BadData::class, IOException::class)
fun mergeCerts(certs: ByteArray): UpdateKey = mergeCerts(certs.inputStream())
/**
* Provide the OpenPGP key to update.
*
* @param key input stream containing the key
* @return handle to acquire the updated OpenPGP key from
*/
@Throws(
SOPGPException.BadData::class,
IOException::class,
@ -45,6 +81,12 @@ interface UpdateKey {
SOPGPException.PrimaryKeyBad::class)
fun key(key: InputStream): Ready
/**
* Provide the OpenPGP key to update.
*
* @param key binary OpenPGP key
* @return handle to acquire the updated OpenPGP key from
*/
@Throws(
SOPGPException.BadData::class,
IOException::class,