1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-14 00:12:06 +01:00

Kotlin conversion: RsaLength

This commit is contained in:
Paul Schaub 2023-09-07 15:21:32 +02:00
parent b76c0461fa
commit 6132636e34
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 17 additions and 29 deletions

View file

@ -1,29 +0,0 @@
// SPDX-FileCopyrightText: 2018 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package org.pgpainless.key.generation.type.rsa;
import org.pgpainless.key.generation.type.KeyLength;
public enum RsaLength implements KeyLength {
@Deprecated
_1024(1024),
@Deprecated
_2048(2048),
_3072(3072),
_4096(4096),
_8192(8192),
;
private final int length;
RsaLength(int length) {
this.length = length;
}
@Override
public int getLength() {
return length;
}
}

View file

@ -0,0 +1,17 @@
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package org.pgpainless.key.generation.type.rsa
import org.pgpainless.key.generation.type.KeyLength
enum class RsaLength(override val length: Int) : KeyLength {
@Deprecated("1024 bits are considered too weak for RSA nowadays.", ReplaceWith("_3072"))
_1024(1024),
@Deprecated("2048 bits are considered too weak for RSA nowadays.", ReplaceWith("_3072"))
_2048(2048),
_3072(3072),
_4096(4096),
_8192(8192)
}