1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-10 18:59:39 +02:00

Kotlin conversion: KeySpec

This commit is contained in:
Paul Schaub 2023-10-09 12:44:15 +02:00
parent bb17c627ce
commit 41f56bdf99
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 28 additions and 62 deletions

View file

@ -0,0 +1,28 @@
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package org.pgpainless.key.generation
import org.bouncycastle.openpgp.PGPSignatureSubpacketVector
import org.pgpainless.algorithm.KeyFlag
import org.pgpainless.key.generation.type.KeyType
import org.pgpainless.signature.subpackets.SignatureSubpackets
import org.pgpainless.signature.subpackets.SignatureSubpacketsHelper
import java.util.*
data class KeySpec(
val keyType: KeyType,
val subpacketGenerator: SignatureSubpackets,
val isInheritedSubPackets: Boolean,
val keyCreationDate: Date
) {
val subpackets: PGPSignatureSubpacketVector
get() = SignatureSubpacketsHelper.toVector(subpacketGenerator)
companion object {
@JvmStatic
fun getBuilder(type: KeyType, vararg flags: KeyFlag) = KeySpecBuilder(type, *flags)
}
}