mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-22 19:08:00 +01:00
Kotlin conversion: RsaLength
This commit is contained in:
parent
2d755be10e
commit
ca3ff6acce
2 changed files with 17 additions and 29 deletions
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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)
|
||||||
|
}
|
Loading…
Reference in a new issue