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

API improvements #153

Closed
FabioPinheiro opened this issue Apr 3, 2024 · 3 comments
Closed

API improvements #153

FabioPinheiro opened this issue Apr 3, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@FabioPinheiro
Copy link

FabioPinheiro commented Apr 3, 2024

Proposed feature

Add Polymorphism to the Key class

Use the @JvmStatic in the companion object

Feature description

Here a list of some things that would be useful:

Have generic types/interface for private keys and for public keys
A private key show extend a public key
A specific private keys should extend the generic private key
A specific public keys should extend the generic public key

The public key should have the following utils methods:

  • method to get the curve
  • get the compress/encoded format (byte array)
  • check point on curve (maybe)
  • maybe also get X and get Y
  • create new instance from curve and compress/encoded data
  • get PublicKey (java class)
    The private key should have the following utils methods:
  • get the compress/encoded format (byte array)
  • create new instance from curve and compress/encoded data (private)
  • get PrivateKey (java class)

WIP

Anything else?

No response

@mkbreuningIOHK
Copy link
Contributor

@elribonazo , this is something to work on to unblock Fabio's work on Crypto agility. Is there someone that can work on it?

@FabioPinheiro
Copy link
Author

FabioPinheiro commented Apr 8, 2024

@mkbreuningIOHK I can work on it. I mean I'm not proficient in Kotlin what I want a small things so I'm pretty sure that I can Frankenstein those into existence.
But @hamada147 mentioned he was going to create a PR with most of the stuff that we discussed. (before I created this ticket)

@FabioPinheiro
Copy link
Author

FabioPinheiro commented Apr 8, 2024

After talking with @goncalo-frade-iohk @elribonazo we agreed that Apollo would only be cryptographic methods. So we may want to remove functionality instead adding more utilities.

So I will do the same as in hyperledger/identus-cloud-agent#958 and create my own warp interface of Apollo.

We also don't want to add the @JvmStatic annotation to improve the companion object API at this point.

I'm closing this ticket (cc @hamada147)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants