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

feat: PrivateHiddenKey #65

Conversation

JeremyTubongbanua
Copy link
Member

What I did

  • _get PrivateHiddenKey
  • _put PrivateHiddenKey (String)
  • _delete PrivateHiddenKey

What's not done:

  • getBinary PrivateHiddenKey
  • put (byte[]) PrivateHiddenKey

closes #48

@JeremyTubongbanua JeremyTubongbanua requested a review from gkc October 13, 2022 15:13
@JeremyTubongbanua JeremyTubongbanua self-assigned this Oct 13, 2022
Copy link
Contributor

@gkc gkc left a comment

Choose a reason for hiding this comment

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

LGTM but can you explain in the PR (1) what a private hidden key is and (2) how this implementation matches the implementation in the Dart client

@JeremyTubongbanua
Copy link
Member Author

LGTM but can you explain in the PR (1) what a private hidden key is and (2) how this implementation matches the implementation in the Dart client

Ah my fault, now that I am looking at the Dart client, PrivateKeys in the Dart client are prefixed with privatekey:... my code makes the keys prefixed with _ because I thought privatekeys were the same as internal hidden keys..

@JeremyTubongbanua
Copy link
Member Author

Should I just close this or refactor everything to InternalKey ?

Also I've tried to create my own privatekey in my secondary manually and it would not work @gkc any idea why?

@smoothalligator@ update:privatekey:test@smoothalligator fascin
org.atsign.common.AtException: error:AT0016-Invalid key : Key privatekey:test@smoothalligator is invalid
        at org.atsign.client.api.impl.secondaries.RemoteSecondary.executeCommand(RemoteSecondary.java:102)
        at org.atsign.client.api.impl.clients.AtClientImpl.executeCommand(AtClientImpl.java:385)
        at org.atsign.client.cli.REPL.repl(REPL.java:183)
        at org.atsign.client.cli.REPL.main(REPL.java:53)
Calling System.exit

Is it because I am only allowed to read private keys and/or modify pre-existing private keys?

@gkc
Copy link
Contributor

gkc commented Oct 17, 2022

Please set up some time to discuss this with @murali-shris ... it's important we retain consistency on the core concepts across SDKs

at_commons has classes & methods to determine what sort of key type a key is. That is canonical, Java SDK should be exactly aligned

@gkc
Copy link
Contributor

gkc commented Oct 17, 2022

Start by looking at AtKey.getKeyType in at_commons

@JeremyTubongbanua
Copy link
Member Author

Thank you @gkc I will close for now because I do not think I did the correct approach.

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.

Implement _get, _put, _delete, PrivateHiddenKey
2 participants