Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add node model #19

Closed
wants to merge 1 commit into from
Closed

Add node model #19

wants to merge 1 commit into from

Conversation

kpcyrd
Copy link
Member

@kpcyrd kpcyrd commented Jan 25, 2015

I've added a mock NodeStore_nodeForAddr method which returns a new Object which is a bit closer to the admin api.

I don't know how to actually call this method, though.

The address gets generated from the public key later.

Feel free to commit on this branch.


public final String publicKey;

public final int linkCount;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is linkCount?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The number of peers, one of the values returned by nodeByAddr

@benhylau
Copy link
Member

How can the Java layer do stuff like getAddressFromPublicKey(publicKey) or encryptWithPrivateKey(arbitraryMessage, nonce) through the native service?

Related: #18

@kpcyrd
Copy link
Member Author

kpcyrd commented Jan 26, 2015

getAddressFromPublicKey is simply double_sha(publicKey), see https://github.com/kpcyrd/yrd/blob/master/cjdns.py#L180

I'm not sure if encryptWithPrivateKey(arbitraryMessage, nonce) is possible.

@benhylau
Copy link
Member

Actually, I don't even need encryptWithPrivateKey(arbitraryMessage, nonce). I just need to sign stuff (i.e. the credentials bundle) with the private key during peering, so the other party knows the credentials came with the authenticated operator of the node. As long as the Java layer has access to the private and public keys, this all can be implemented by integrating NaCl.

@kpcyrd
Copy link
Member Author

kpcyrd commented Jan 27, 2015

You can read the private key from the config, but I'm not sure if it should be used for anything except cjdns.

@benhylau
Copy link
Member

@kpcyrd See Step 4 of this. Can't think of another way to verify other than signing with the cjdns private key.

@kpcyrd
Copy link
Member Author

kpcyrd commented Jan 27, 2015

I was busy and couldn't comment on this, yet. Sorry for that, I'll try to contribute in the next view days.

@benhylau
Copy link
Member

benhylau commented Feb 3, 2015

@kpcyrd I will work on this branch when I get to the Node part after the Credentials. Thanks!

@benhylau benhylau mentioned this pull request Feb 12, 2015
@benhylau
Copy link
Member

Rebased and created branch in this repo so it's easier to work with. Closing this PR, k?

See #34

@benhylau benhylau closed this Feb 12, 2015
@kpcyrd kpcyrd deleted the node-model branch February 12, 2015 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants