Skip to content

Commit 2c3b28e

Browse files
authored
feat!: introduce SignerKey class for enhanced signer key handling. (#712)
1 parent a5cb912 commit 2c3b28e

18 files changed

+808
-418
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
## Pending
44

5+
### Update:
6+
- feat: add `isValidSignedPayload` to `StrKey` class, this function can be used to validate the ed25519 signed payload. ([#712](https://github.com/stellar/java-stellar-sdk/pull/712))
7+
8+
### Breaking changes:
9+
- feat: add `org.stellar.sdk.SignerKey` for enhanced signer key handling. ([#712](https://github.com/stellar/java-stellar-sdk/pull/712))
10+
- `org.stellar.sdk.Signer` and `org.stellar.sdk.SignedPayloadSigner` has been removed, use `org.stellar.sdk.SignerKey` instead.
11+
- The `StrKey#encodeSignedPayload(SignedPayloadSigner)` and `StrKey#decodeSignedPayload(String)` methods now operate on raw `byte[]` instead of the `SignedPayloadSigner` object to provide more flexibility.
12+
- `KeyPair#fromXdrSignerKey()` and `KeyPair#getXdrSignerKey()` have been removed, use `org.stellar.sdk.SignerKey` instead.
13+
- The type of `TransactionPreconditions#extraSigners` has been changed from `List<org.stellar.sdk.xdr.SignerKey>` to `List<org.stellar.sdk.SignerKey>`.
14+
- The type of `SetOptionsOperation#signer` has been changed from `org.stellar.sdk.xdr.SignerKey` to `org.stellar.sdk.SignerKey`.
15+
- The type of `RevokeSignerSponsorshipOperation#signer` has been changed from `org.stellar.sdk.xdr.SignerKey` to `org.stellar.sdk.SignerKey`.
16+
517
## 2.0.0-beta0
618

719
### Update:

src/main/java/org/stellar/sdk/KeyPair.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import org.stellar.sdk.xdr.DecoratedSignature;
2121
import org.stellar.sdk.xdr.PublicKeyType;
2222
import org.stellar.sdk.xdr.SignatureHint;
23-
import org.stellar.sdk.xdr.SignerKey;
24-
import org.stellar.sdk.xdr.SignerKeyType;
2523
import org.stellar.sdk.xdr.Uint256;
2624
import org.stellar.sdk.xdr.XdrDataOutputStream;
2725

@@ -224,16 +222,6 @@ public AccountID getXdrAccountId() {
224222
return accountID;
225223
}
226224

227-
/** Returns the XDR {@link SignerKey} for this keypair. */
228-
public SignerKey getXdrSignerKey() {
229-
SignerKey signerKey = new SignerKey();
230-
signerKey.setDiscriminant(SignerKeyType.SIGNER_KEY_TYPE_ED25519);
231-
Uint256 uint256 = new Uint256();
232-
uint256.setUint256(getPublicKey());
233-
signerKey.setEd25519(uint256);
234-
return signerKey;
235-
}
236-
237225
/**
238226
* Creates a new KeyPair from an XDR {@link org.stellar.sdk.xdr.PublicKey}.
239227
*
@@ -244,16 +232,6 @@ public static KeyPair fromXdrPublicKey(org.stellar.sdk.xdr.PublicKey key) {
244232
return KeyPair.fromPublicKey(key.getEd25519().getUint256());
245233
}
246234

247-
/**
248-
* Creates a new KeyPair from an XDR {@link SignerKey}.
249-
*
250-
* @param key The XDR {@link SignerKey} object.
251-
* @return KeyPair
252-
*/
253-
public static KeyPair fromXdrSignerKey(SignerKey key) {
254-
return KeyPair.fromPublicKey(key.getEd25519().getUint256());
255-
}
256-
257235
/**
258236
* Sign the provided data with the keypair's private key.
259237
*

src/main/java/org/stellar/sdk/SignedPayloadSigner.java

Lines changed: 0 additions & 68 deletions
This file was deleted.

src/main/java/org/stellar/sdk/Signer.java

Lines changed: 0 additions & 100 deletions
This file was deleted.

0 commit comments

Comments
 (0)