add spring security and token management
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package com.iconplus.smartproc.configuration;
|
||||
|
||||
import com.iconplus.smartproc.util.RSAUtil;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.security.KeyPair;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.PublicKey;
|
||||
|
||||
@Configuration
|
||||
public class KeyConfiguration {
|
||||
|
||||
@Value("${jwt.private-key}")
|
||||
private String privateKey;
|
||||
|
||||
@Value("${jwt.public-key}")
|
||||
private String publicKey;
|
||||
|
||||
@Bean
|
||||
public KeyPair keypairBean() {
|
||||
|
||||
PublicKey pubKey = RSAUtil.getPublicKey(publicKey);
|
||||
PrivateKey privKey = RSAUtil.getPrivateKey(privateKey);
|
||||
|
||||
return new KeyPair(pubKey, privKey);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user