### Question:
KeyPairSecurityModule implements SecurityModule { @Override public PublicKey getPublicKey() throws SecurityModuleException { return publicKey; } KeyPairSecurityModule(final SECP256K1.KeyPair keyPair); @Override Signature sign(final Bytes32 dataHash); @Override PublicKey getPublicKey(); @Override Bytes32 calculateECDHKeyAgreement(final PublicKey partyKey);  }### Answer:
@Test public void validatePublicKeyFromECPointCanBeConstructed() throws IOException { final File keyDirectory = temp.newFolder(); final File keyFile = new File(keyDirectory, "key"); final SECP256K1.KeyPair keyPair = KeyPairUtil.loadKeyPair(keyFile); final KeyPairSecurityModule keyPairSecurityModule = new KeyPairSecurityModule(keyPair); final ECPoint ecPoint = keyPairSecurityModule.getPublicKey().getW(); final Bytes encodedBytes = ECPointUtil.getEncodedBytes(ecPoint); final SECP256K1.PublicKey publicKey = SECP256K1.PublicKey.create(encodedBytes); Assertions.assertThat(keyPair.getPublicKey().getEncodedBytes()) .isEqualByComparingTo(publicKey.getEncodedBytes()); }