Add implementation of merge-certs command

This commit is contained in:
Paul Schaub 2024-09-17 22:43:50 +02:00
parent 4115a5041d
commit 84404d629f
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
6 changed files with 116 additions and 0 deletions

View file

@ -64,4 +64,9 @@ interface SOP : SOPV {
* Keep a secret key up-to-date.
*/
fun updateKey(): UpdateKey
/**
* Merge OpenPGP certificates.
*/
fun mergeCerts(): MergeCerts
}

View file

@ -0,0 +1,28 @@
// 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 java.io.IOException
import java.io.InputStream
interface MergeCerts {
@Throws(SOPGPException.UnsupportedOption::class)
fun noArmor(): MergeCerts
@Throws(SOPGPException.BadData::class, IOException::class)
fun updates(updateCerts: InputStream): MergeCerts
@Throws(SOPGPException.BadData::class, IOException::class)
fun updates(updateCerts: ByteArray): MergeCerts = updates(updateCerts.inputStream())
@Throws(SOPGPException.BadData::class, IOException::class)
fun baseCertificates(certs: InputStream): Ready
@Throws(SOPGPException.BadData::class, IOException::class)
fun baseCertificates(certs: ByteArray): Ready = baseCertificates(certs.inputStream())
}