This file contains hidden or 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
Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); | |
cipher.init(Cipher.DECRYPT_MODE, aesSecretKey, new GCMParameterSpec(128, iv)); | |
byte[] decryptedData = cipher.doFinal(encryptedData); | |
String decryptedMessage = new String(decryptedData); |
This file contains hidden or 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
Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); | |
cipher.init(Cipher.ENCRYPT_MODE, aesSecretKey, new GCMParameterSpec(128, iv)); | |
cipher.doFinal("Some message".getBytes()); |
This file contains hidden or 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
KeyGenerator keyGenerator = KeyGenerator.getInstance("AES"); | |
SecretKey aesSecretKey = keyGenerator.generateKey(); |
This file contains hidden or 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
SecureRandom secureRandom = new SecureRandom(); | |
byte[] secretKey = new byte[16]; | |
secureRandom.nextBytes(secretKey); | |
SecretKey aesSecretKey = new SecretKeySpec(secretKey, "AES"); |
This file contains hidden or 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
Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); | |
cipher.init(Cipher.DECRYPT_MODE, aesSecretKey, new GCMParameterSpec(128, iv)); | |
byte[] decryptedData = cipher.doFinal(encryptedData); | |
String decryptedMessage = new String(decryptedData); |
This file contains hidden or 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
plugins { | |
id 'org.springframework.boot' version '2.2.1.RELEASE' | |
id 'io.spring.dependency-management' version '1.0.8.RELEASE' | |
id 'java' | |
} | |
group = 'com.softwaremill' | |
version = '0.0.1-SNAPSHOT' | |
sourceCompatibility = '1.8' | |
repositories { | |
mavenCentral() |
This file contains hidden or 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
val slackConnectionFlow = Http().outgoingConnectionHttps("slack.com") | |
val token = "" //oauth token | |
val uri = Uri("/api/users.list").withQuery( | |
Query( | |
("token", token) | |
) | |
) | |
val request = RequestBuilding.Get(uri) | |
//executing the request |
This file contains hidden or 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
val query = Query(Transactions.length) | |
val stmt = query.selectStatement | |
stmt => select x2.x3 from (select count(1) as x3 from (select x4."TRANSACTION_ID", x4."TERMINAL_ID", x4."MERCHANT_ID", x4."CUSTOMER_ID", x4."AMOUNT", x4."CURRENCY", x4."TIMESTAMP" from "TRANSACTIONS" x4) x5) x2 |
This file contains hidden or 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
/** | |
* Fills traffic lights grid object with chart data retrieved from JSON or XML. | |
* @param grid Grid object to be filled with data. | |
* @param chart Chart data retrieved from JSON or XML. | |
* @param invertColor Indicates if colors should be inverted. | |
* @return Grid filled with data. | |
*/ | |
public Grid fetchScoreCardGrid(PortletRequest request, MimeResponse response, Map<String, Object> reportParameters) throws Exception { |
This file contains hidden or 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
trait Dependency { | |
def doSomething() | |
} | |
class ConcreteDependency extends Dependency { | |
def doSomething { | |
println("Doing something from ConcreteDependency") | |
} | |
} |
NewerOlder