KeyPair { public boolean canSign() { return mPrivateKey != null; } KeyPair(EdDSAPublicKey publicKey);  KeyPair(EdDSAPublicKey publicKey, EdDSAPrivateKey privateKey); boolean canSign(); static KeyPair fromSecretSeed(char[] seed); static KeyPair fromSecretSeed(String seed); static KeyPair fromSecretSeed(byte[] seed); static KeyPair fromAccountId(String accountId); static KeyPair fromPublicKey(byte[] publicKey); static KeyPair random(); String getAccountId(); char[] getSecretSeed(); byte[] getRawSecretSeed(); byte[] getPublicKey(); SignatureHint getSignatureHint(); PublicKey getXdrPublicKey(); SignerKey getXdrSignerKey(); static KeyPair fromXdrPublicKey(PublicKey key); static KeyPair fromXdrSignerKey(SignerKey key); byte[] sign(byte[] data); DecoratedSignature signDecorated(byte[] data); boolean verify(byte[] data, byte[] signature); @Override boolean equals(Object obj);  }
@Test public void testCanSign() throws Exception { KeyPair keypair; keypair = KeyPair.fromSecretSeed("SDJHRQF4GCMIIKAAAQ6IHY42X73FQFLHUULAPSKKD4DFDM7UXWWCRHBE"); assertTrue(keypair.canSign()); keypair = KeyPair.fromAccountId("GABXJTV7ELEB2TQZKJYEGXBUIG6QODJULKJDI65KZMIZZG2EACJU5EA7"); assertFalse(keypair.canSign()); }