@Test public void testFromPublicKey() { assertThat(AuthenticationKey.fromPublicKey(PublicKey.fromHexString(JAVA_PUB_KEY)).toString(), is(AUTH_KEY)); }
public static AuthenticationKey fromPublicKey(PublicKey publicKey) { byte[] pkBytes = publicKey.toArray(); byte[] pkBytesWithSignatureSchemeId = new byte[PUBLIC_KEY_LENGTH + 1]; System.arraycopy(pkBytes, 0, pkBytesWithSignatureSchemeId, 0, PUBLIC_KEY_LENGTH); pkBytesWithSignatureSchemeId[PUBLIC_KEY_LENGTH] = SIGNATURE_SCHEME_ED25519; return new AuthenticationKey(Hash.ofInput(ByteArray.from(pkBytesWithSignatureSchemeId)).hash()); }
AuthenticationKey implements ByteSequence { public static AuthenticationKey fromPublicKey(PublicKey publicKey) { byte[] pkBytes = publicKey.toArray(); byte[] pkBytesWithSignatureSchemeId = new byte[PUBLIC_KEY_LENGTH + 1]; System.arraycopy(pkBytes, 0, pkBytesWithSignatureSchemeId, 0, PUBLIC_KEY_LENGTH); pkBytesWithSignatureSchemeId[PUBLIC_KEY_LENGTH] = SIGNATURE_SCHEME_ED25519; return new AuthenticationKey(Hash.ofInput(ByteArray.from(pkBytesWithSignatureSchemeId)).hash()); } }
AuthenticationKey implements ByteSequence { public static AuthenticationKey fromPublicKey(PublicKey publicKey) { byte[] pkBytes = publicKey.toArray(); byte[] pkBytesWithSignatureSchemeId = new byte[PUBLIC_KEY_LENGTH + 1]; System.arraycopy(pkBytes, 0, pkBytesWithSignatureSchemeId, 0, PUBLIC_KEY_LENGTH); pkBytesWithSignatureSchemeId[PUBLIC_KEY_LENGTH] = SIGNATURE_SCHEME_ED25519; return new AuthenticationKey(Hash.ofInput(ByteArray.from(pkBytesWithSignatureSchemeId)).hash()); } private  AuthenticationKey(ByteArray bytes); }
AuthenticationKey implements ByteSequence { public static AuthenticationKey fromPublicKey(PublicKey publicKey) { byte[] pkBytes = publicKey.toArray(); byte[] pkBytesWithSignatureSchemeId = new byte[PUBLIC_KEY_LENGTH + 1]; System.arraycopy(pkBytes, 0, pkBytesWithSignatureSchemeId, 0, PUBLIC_KEY_LENGTH); pkBytesWithSignatureSchemeId[PUBLIC_KEY_LENGTH] = SIGNATURE_SCHEME_ED25519; return new AuthenticationKey(Hash.ofInput(ByteArray.from(pkBytesWithSignatureSchemeId)).hash()); } private  AuthenticationKey(ByteArray bytes); static AuthenticationKey fromPublicKey(PublicKey publicKey); static AuthenticationKey fromMultiSignaturePublicKey(MultiSignaturePublicKey publicKey); static AuthenticationKey fromPublicKey(java.security.PublicKey javaPublicKey); static AuthenticationKey fromByteArray(ByteArray bytes); static AuthenticationKey fromHexString(String hexString); ByteArray toByteArray(); ByteArray prefix(); @Override byte[] toArray(); @Override String toString(); }
AuthenticationKey implements ByteSequence { public static AuthenticationKey fromPublicKey(PublicKey publicKey) { byte[] pkBytes = publicKey.toArray(); byte[] pkBytesWithSignatureSchemeId = new byte[PUBLIC_KEY_LENGTH + 1]; System.arraycopy(pkBytes, 0, pkBytesWithSignatureSchemeId, 0, PUBLIC_KEY_LENGTH); pkBytesWithSignatureSchemeId[PUBLIC_KEY_LENGTH] = SIGNATURE_SCHEME_ED25519; return new AuthenticationKey(Hash.ofInput(ByteArray.from(pkBytesWithSignatureSchemeId)).hash()); } private  AuthenticationKey(ByteArray bytes); static AuthenticationKey fromPublicKey(PublicKey publicKey); static AuthenticationKey fromMultiSignaturePublicKey(MultiSignaturePublicKey publicKey); static AuthenticationKey fromPublicKey(java.security.PublicKey javaPublicKey); static AuthenticationKey fromByteArray(ByteArray bytes); static AuthenticationKey fromHexString(String hexString); ByteArray toByteArray(); ByteArray prefix(); @Override byte[] toArray(); @Override String toString();  }