File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
src/main/java/com/github/renovatebot Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ plugins {
1515
1616dependencies {
1717 implementation(libs.bouncycastle.bcpg)
18- implementation(project(" :tools:teavm-plugin" ))
18+ // implementation(project(":tools:teavm-plugin"))
1919 teavm(teavm.libs.jsoApis)
2020}
2121
Original file line number Diff line number Diff line change 11package com .github .renovatebot ;
22
3+ import java .io .ByteArrayInputStream ;
4+ import java .io .IOException ;
35import java .nio .charset .StandardCharsets ;
46
7+ import org .bouncycastle .bcpg .ArmoredInputStream ;
8+ import org .bouncycastle .openpgp .PGPException ;
59import org .teavm .jso .JSExport ;
610
711public final class Main {
@@ -11,9 +15,13 @@ private Main() {
1115 }
1216
1317 @ JSExport
14- public static String decrypt (String key , String msg ) {
15- final var bytes = "test" .getBytes (StandardCharsets .US_ASCII );
18+ public static String decrypt (String key , String msg ) throws IOException , PGPException {
19+ final var builder = ArmoredInputStream .builder ().setIgnoreCRC (true );
20+ final var bytes = msg .getBytes (StandardCharsets .UTF_8 );
21+ final var input = builder .build (new ByteArrayInputStream (bytes ));
1622
17- return "test" + bytes .length ;
23+ input .close ();
24+
25+ return "test -> " + bytes .length ;
1826 }
1927}
You can’t perform that action at this time.
0 commit comments