mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2025-09-09 18:29:48 +02:00
Implement certify-userid command
This commit is contained in:
parent
ada77be955
commit
d6c1330874
6 changed files with 177 additions and 0 deletions
|
@ -69,4 +69,9 @@ interface SOP : SOPV {
|
|||
* Merge OpenPGP certificates.
|
||||
*/
|
||||
fun mergeCerts(): MergeCerts
|
||||
|
||||
/**
|
||||
* Certify OpenPGP Certificate User-IDs.
|
||||
*/
|
||||
fun certifyUserId(): CertifyUserId
|
||||
}
|
||||
|
|
41
sop-java/src/main/kotlin/sop/operation/CertifyUserId.kt
Normal file
41
sop-java/src/main/kotlin/sop/operation/CertifyUserId.kt
Normal 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())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue