Implement certify-userid command

This commit is contained in:
Paul Schaub 2024-09-18 16:01:30 +02:00
parent ada77be955
commit d6c1330874
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
6 changed files with 177 additions and 0 deletions

View file

@ -69,4 +69,9 @@ interface SOP : SOPV {
* Merge OpenPGP certificates.
*/
fun mergeCerts(): MergeCerts
/**
* Certify OpenPGP Certificate User-IDs.
*/
fun certifyUserId(): CertifyUserId
}

View file

@ -0,0 +1,41 @@
// SPDX-FileCopyrightText: 2024 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package sop.operation
import sop.Ready
import sop.exception.SOPGPException
import sop.util.UTF8Util
import java.io.IOException
import java.io.InputStream
interface CertifyUserId {
@Throws(SOPGPException.UnsupportedOption::class)
fun noArmor(): CertifyUserId
@Throws(SOPGPException.UnsupportedOption::class)
fun userId(userId: String): CertifyUserId
@Throws(SOPGPException.PasswordNotHumanReadable::class, SOPGPException.UnsupportedOption::class)
fun withKeyPassword(password: String): CertifyUserId = withKeyPassword(password.toByteArray(UTF8Util.UTF8))
@Throws(SOPGPException.PasswordNotHumanReadable::class, SOPGPException.UnsupportedOption::class)
fun withKeyPassword(password: ByteArray): CertifyUserId
@Throws(SOPGPException.UnsupportedOption::class)
fun noRequireSelfSig(): CertifyUserId
@Throws(SOPGPException.BadData::class, IOException::class, SOPGPException.KeyIsProtected::class)
fun keys(keys: InputStream): CertifyUserId
@Throws(SOPGPException.BadData::class, IOException::class, SOPGPException.KeyIsProtected::class)
fun keys(keys: ByteArray): CertifyUserId = keys(keys.inputStream())
@Throws(SOPGPException.BadData::class, IOException::class, SOPGPException.CertUserIdNoMatch::class)
fun certs(certs: InputStream): Ready
@Throws(SOPGPException.BadData::class, IOException::class, SOPGPException.CertUserIdNoMatch::class)
fun certs(certs: ByteArray): Ready = certs(certs.inputStream())
}