Wip
This commit is contained in:
@@ -76,6 +76,11 @@
|
||||
<artifactId>kotlinx-datetime-jvm</artifactId>
|
||||
<version>0.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.16.1</version>
|
||||
</dependency>
|
||||
<!-- servlets and mail APIs -->
|
||||
<dependency>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package org.jeudego.pairgoth.util
|
||||
|
||||
import org.apache.commons.codec.binary.Base64
|
||||
import java.io.Serializable
|
||||
|
||||
/**
|
||||
@@ -26,4 +27,10 @@ interface Cryptograph : Serializable {
|
||||
* @return decrypted string
|
||||
*/
|
||||
fun decrypt(bytes: ByteArray): String
|
||||
|
||||
|
||||
fun webEncrypt(str: String) = Base64.encodeBase64URLSafeString(encrypt(str))
|
||||
|
||||
fun webDecrypt(str: String) = decrypt(Base64.decodeBase64(str))
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user