mirror of
https://github.com/tursom/TursomServer.git
synced 2025-02-08 02:30:36 +08:00
update RSA, add public RSA object
This commit is contained in:
parent
9c473813af
commit
39ed6ad7e3
@ -19,6 +19,14 @@ class RSA(val publicKey: RSAPublicKey, val privateKey: RSAPrivateKey? = null) :
|
||||
val decryptMaxLen = keySize / 8
|
||||
val encryptMaxLen = decryptMaxLen - 11
|
||||
|
||||
val public by lazy {
|
||||
if (privateKey == null) {
|
||||
this
|
||||
} else {
|
||||
RSA(publicKey)
|
||||
}
|
||||
}
|
||||
|
||||
private val encryptCipher = Cipher.getInstance("RSA")!!
|
||||
private val decryptCipher = Cipher.getInstance("RSA")!!
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user