Как это сделать?
Код: Выделить всё
import com.example.em_card_service.data.properties.EncryptionProperties;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.encrypt.Encryptors;
import org.springframework.security.crypto.encrypt.TextEncryptor;
import java.util.List;
@Configuration
@RequiredArgsConstructor
public class SecurityConfig {
private final EncryptionProperties encryptionProperties;
// more beans
@Bean
public TextEncryptor textEncryptor() {
return Encryptors.text(encryptionProperties.getPassword(), encryptionProperties.getSalt());
}
}