Created
July 25, 2021 00:34
-
-
Save Anass-ABEA/37e56bbd55391a94589c2fe10d3895e7 to your computer and use it in GitHub Desktop.
RSA Server Controller ( Encryption )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.thexcoders.RSA_server.controllers; | |
import com.thexcoders.RSA_server.EncryptionManager; | |
import org.springframework.web.bind.annotation.GetMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
@RestController | |
public class ApplicationController { | |
@GetMapping("getSecretMessage") | |
public String getMessage(){ | |
String message = "TheXCoders"; | |
EncryptionManager manager = new EncryptionManager(); | |
manager.initFromStrings(); | |
try{ | |
return manager.encrypt(message); | |
}catch (Exception ignored){} | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment