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:
parent
bb17c627ce
commit
41f56bdf99
2 changed files with 28 additions and 62 deletions
|
@ -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)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue