Skip to content

Commit 932e995

Browse files
committed
Upgrade implementations to use core 3.0.2
1 parent 5c07196 commit 932e995

File tree

6 files changed

+28
-28
lines changed

6 files changed

+28
-28
lines changed

core/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ plugins {
1010
id("signing")
1111
}
1212

13-
def jarVersion = "3.0.2"
13+
def jarVersion = "3.0.3"
1414
group = 'io.nats.nkeys'
1515

1616
def isRelease = System.getenv("BUILD_EVENT") == "release"

fips/src/test/java/io/nats/nkey/FipsProviderTests.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public void testAccount() {
4747
assertNotNull(theKey);
4848

4949
char[] seed = theKey.getSeed();
50-
NKeyInternalUtils.decodeSeed(seed); // throws if there is an issue
50+
NKeyProviderUtils.decodeSeed(seed); // throws if there is an issue
5151

5252
assertEquals(PROVIDER.fromSeed(theKey.getSeed()), PROVIDER.fromSeed(theKey.getSeed()));
5353

@@ -81,7 +81,7 @@ public void testUser() {
8181
assertNotNull(theKey);
8282

8383
char[] seed = theKey.getSeed();
84-
NKeyInternalUtils.decodeSeed(seed); // throws if there is an issue
84+
NKeyProviderUtils.decodeSeed(seed); // throws if there is an issue
8585

8686
assertEquals(PROVIDER.fromSeed(theKey.getSeed()), PROVIDER.fromSeed(theKey.getSeed()));
8787

@@ -115,7 +115,7 @@ public void testCluster() {
115115
assertNotNull(theKey);
116116

117117
char[] seed = theKey.getSeed();
118-
NKeyInternalUtils.decodeSeed(seed); // throws if there is an issue
118+
NKeyProviderUtils.decodeSeed(seed); // throws if there is an issue
119119

120120
assertEquals(PROVIDER.fromSeed(theKey.getSeed()), PROVIDER.fromSeed(theKey.getSeed()));
121121

@@ -149,7 +149,7 @@ public void testOperator() {
149149
assertNotNull(theKey);
150150

151151
char[] seed = theKey.getSeed();
152-
NKeyInternalUtils.decodeSeed(seed); // throws if there is an issue
152+
NKeyProviderUtils.decodeSeed(seed); // throws if there is an issue
153153

154154
assertEquals(PROVIDER.fromSeed(theKey.getSeed()), PROVIDER.fromSeed(theKey.getSeed()));
155155

@@ -183,7 +183,7 @@ public void testServer() {
183183
assertNotNull(theKey);
184184

185185
char[] seed = theKey.getSeed();
186-
NKeyInternalUtils.decodeSeed(seed); // throws if there is an issue
186+
NKeyProviderUtils.decodeSeed(seed); // throws if there is an issue
187187

188188
assertEquals(PROVIDER.fromSeed(theKey.getSeed()), PROVIDER.fromSeed(theKey.getSeed()));
189189

@@ -406,8 +406,8 @@ public void testInterop() {
406406
assertArrayEquals(fromSeed.getPublicKey(), publicKey);
407407
assertArrayEquals(fromSeed.getPrivateKey(), privateKey);
408408

409-
NKeyDecodedSeed decoded = NKeyInternalUtils.decodeSeed(seed);
410-
char[] encodedSeed = NKeyInternalUtils.encodeSeed(NKeyType.fromPrefix(decoded.prefix), decoded.bytes);
409+
NKeyDecodedSeed decoded = NKeyProviderUtils.decodeSeed(seed);
410+
char[] encodedSeed = NKeyProviderUtils.encodeSeed(NKeyType.fromPrefix(decoded.prefix), decoded.bytes);
411411
assertArrayEquals(encodedSeed, seed);
412412
}
413413

lts/src/main/java/io/nats/nkey/LtsNKeyProvider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
import static io.nats.nkey.NKeyConstants.ED25519_PUBLIC_KEYSIZE;
1111
import static io.nats.nkey.NKeyConstants.ED25519_SEED_SIZE;
12-
import static io.nats.nkey.NKeyInternalUtils.decode;
13-
import static io.nats.nkey.NKeyInternalUtils.encodeSeed;
12+
import static io.nats.nkey.NKeyProviderUtils.encodeSeed;
13+
import static io.nats.nkey.NKeyProviderUtils.nkeyDecode;
1414

1515
@NullMarked
1616
public class LtsNKeyProvider extends NKeyProvider {
@@ -75,7 +75,7 @@ public boolean verify(NKey nkey, byte[] input, byte[] signature) {
7575
}
7676
else {
7777
char[] encodedPublicKey = nkey.getPublicKey();
78-
byte[] decodedPublicKey = decode(nkey.getType(), encodedPublicKey);
78+
byte[] decodedPublicKey = nkeyDecode(nkey.getType(), encodedPublicKey);
7979
publicKey = new Ed25519PublicKeyParameters(decodedPublicKey);
8080
}
8181

lts/src/test/java/io/nats/nkey/LtsProviderTests.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void testAccount() {
4848
assertNotNull(theKey);
4949

5050
char[] seed = theKey.getSeed();
51-
NKeyInternalUtils.decodeSeed(seed); // throws if there is an issue
51+
NKeyProviderUtils.decodeSeed(seed); // throws if there is an issue
5252

5353
assertEquals(PROVIDER.fromSeed(theKey.getSeed()), PROVIDER.fromSeed(theKey.getSeed()));
5454

@@ -82,7 +82,7 @@ public void testUser() {
8282
assertNotNull(theKey);
8383

8484
char[] seed = theKey.getSeed();
85-
NKeyInternalUtils.decodeSeed(seed); // throws if there is an issue
85+
NKeyProviderUtils.decodeSeed(seed); // throws if there is an issue
8686

8787
assertEquals(PROVIDER.fromSeed(theKey.getSeed()), PROVIDER.fromSeed(theKey.getSeed()));
8888

@@ -116,7 +116,7 @@ public void testCluster() {
116116
assertNotNull(theKey);
117117

118118
char[] seed = theKey.getSeed();
119-
NKeyInternalUtils.decodeSeed(seed); // throws if there is an issue
119+
NKeyProviderUtils.decodeSeed(seed); // throws if there is an issue
120120

121121
assertEquals(PROVIDER.fromSeed(theKey.getSeed()), PROVIDER.fromSeed(theKey.getSeed()));
122122

@@ -150,7 +150,7 @@ public void testOperator() {
150150
assertNotNull(theKey);
151151

152152
char[] seed = theKey.getSeed();
153-
NKeyInternalUtils.decodeSeed(seed); // throws if there is an issue
153+
NKeyProviderUtils.decodeSeed(seed); // throws if there is an issue
154154

155155
assertEquals(PROVIDER.fromSeed(theKey.getSeed()), PROVIDER.fromSeed(theKey.getSeed()));
156156

@@ -184,7 +184,7 @@ public void testServer() {
184184
assertNotNull(theKey);
185185

186186
char[] seed = theKey.getSeed();
187-
NKeyInternalUtils.decodeSeed(seed); // throws if there is an issue
187+
NKeyProviderUtils.decodeSeed(seed); // throws if there is an issue
188188

189189
assertEquals(PROVIDER.fromSeed(theKey.getSeed()), PROVIDER.fromSeed(theKey.getSeed()));
190190

@@ -407,8 +407,8 @@ public void testInterop() {
407407
assertArrayEquals(fromSeed.getPublicKey(), publicKey);
408408
assertArrayEquals(fromSeed.getPrivateKey(), privateKey);
409409

410-
NKeyDecodedSeed decoded = NKeyInternalUtils.decodeSeed(seed);
411-
char[] encodedSeed = NKeyInternalUtils.encodeSeed(NKeyType.fromPrefix(decoded.prefix), decoded.bytes);
410+
NKeyDecodedSeed decoded = NKeyProviderUtils.decodeSeed(seed);
411+
char[] encodedSeed = NKeyProviderUtils.encodeSeed(NKeyType.fromPrefix(decoded.prefix), decoded.bytes);
412412
assertArrayEquals(encodedSeed, seed);
413413
}
414414

regular/src/main/java/io/nats/nkey/RegularNKeyProvider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
import static io.nats.nkey.NKeyConstants.ED25519_PUBLIC_KEYSIZE;
1111
import static io.nats.nkey.NKeyConstants.ED25519_SEED_SIZE;
12-
import static io.nats.nkey.NKeyInternalUtils.decode;
13-
import static io.nats.nkey.NKeyInternalUtils.encodeSeed;
12+
import static io.nats.nkey.NKeyProviderUtils.encodeSeed;
13+
import static io.nats.nkey.NKeyProviderUtils.nkeyDecode;
1414

1515
@NullMarked
1616
public class RegularNKeyProvider extends NKeyProvider {
@@ -74,7 +74,7 @@ public boolean verify(NKey nkey, byte[] input, byte[] signature) {
7474
}
7575
else {
7676
char[] encodedPublicKey = nkey.getPublicKey();
77-
byte[] decodedPublicKey = decode(nkey.getType(), encodedPublicKey);
77+
byte[] decodedPublicKey = nkeyDecode(nkey.getType(), encodedPublicKey);
7878
publicKey = new Ed25519PublicKeyParameters(decodedPublicKey);
7979
}
8080

regular/src/test/java/io/nats/nkey/RegularProviderTests.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void testAccount() {
4343
assertNotNull(theKey);
4444

4545
char[] seed = theKey.getSeed();
46-
NKeyInternalUtils.decodeSeed(seed); // throws if there is an issue
46+
NKeyProviderUtils.decodeSeed(seed); // throws if there is an issue
4747

4848
assertEquals(PROVIDER.fromSeed(theKey.getSeed()), PROVIDER.fromSeed(theKey.getSeed()));
4949

@@ -77,7 +77,7 @@ public void testUser() {
7777
assertNotNull(theKey);
7878

7979
char[] seed = theKey.getSeed();
80-
NKeyInternalUtils.decodeSeed(seed); // throws if there is an issue
80+
NKeyProviderUtils.decodeSeed(seed); // throws if there is an issue
8181

8282
assertEquals(PROVIDER.fromSeed(theKey.getSeed()), PROVIDER.fromSeed(theKey.getSeed()));
8383

@@ -111,7 +111,7 @@ public void testCluster() {
111111
assertNotNull(theKey);
112112

113113
char[] seed = theKey.getSeed();
114-
NKeyInternalUtils.decodeSeed(seed); // throws if there is an issue
114+
NKeyProviderUtils.decodeSeed(seed); // throws if there is an issue
115115

116116
assertEquals(PROVIDER.fromSeed(theKey.getSeed()), PROVIDER.fromSeed(theKey.getSeed()));
117117

@@ -145,7 +145,7 @@ public void testOperator() {
145145
assertNotNull(theKey);
146146

147147
char[] seed = theKey.getSeed();
148-
NKeyInternalUtils.decodeSeed(seed); // throws if there is an issue
148+
NKeyProviderUtils.decodeSeed(seed); // throws if there is an issue
149149

150150
assertEquals(PROVIDER.fromSeed(theKey.getSeed()), PROVIDER.fromSeed(theKey.getSeed()));
151151

@@ -179,7 +179,7 @@ public void testServer() {
179179
assertNotNull(theKey);
180180

181181
char[] seed = theKey.getSeed();
182-
NKeyInternalUtils.decodeSeed(seed); // throws if there is an issue
182+
NKeyProviderUtils.decodeSeed(seed); // throws if there is an issue
183183

184184
assertEquals(PROVIDER.fromSeed(theKey.getSeed()), PROVIDER.fromSeed(theKey.getSeed()));
185185

@@ -402,8 +402,8 @@ public void testInterop() {
402402
assertArrayEquals(fromSeed.getPublicKey(), publicKey);
403403
assertArrayEquals(fromSeed.getPrivateKey(), privateKey);
404404

405-
NKeyDecodedSeed decoded = NKeyInternalUtils.decodeSeed(seed);
406-
char[] encodedSeed = NKeyInternalUtils.encodeSeed(NKeyType.fromPrefix(decoded.prefix), decoded.bytes);
405+
NKeyDecodedSeed decoded = NKeyProviderUtils.decodeSeed(seed);
406+
char[] encodedSeed = NKeyProviderUtils.encodeSeed(NKeyType.fromPrefix(decoded.prefix), decoded.bytes);
407407
assertArrayEquals(encodedSeed, seed);
408408
}
409409

0 commit comments

Comments
 (0)