Kotlin conversion: XDHSpec

This commit is contained in:
Paul Schaub 2023-09-07 15:26:24 +02:00
parent 2af8c55250
commit 1f87f184bc
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
2 changed files with 15 additions and 34 deletions

View File

@ -1,34 +0,0 @@
// SPDX-FileCopyrightText: 2020 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package org.pgpainless.key.generation.type.xdh;
import javax.annotation.Nonnull;
public enum XDHSpec {
_X25519("X25519", "curve25519", 256),
;
final String name;
final String curveName;
final int bitStrength;
XDHSpec(@Nonnull String name, @Nonnull String curveName, int bitStrength) {
this.name = name;
this.curveName = curveName;
this.bitStrength = bitStrength;
}
public String getName() {
return name;
}
public String getCurveName() {
return curveName;
}
public int getBitStrength() {
return bitStrength;
}
}

View File

@ -0,0 +1,15 @@
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package org.pgpainless.key.generation.type.xdh
enum class XDHSpec(
val algorithmName: String,
val curveName: String,
val bitStrength: Int) {
_X25519("X25519", "curve25519", 256),
;
fun getName() = algorithmName
}