Comments (4)
Oh, I just looked and realized libp2p-crypto already has GenerateKeyPair(), which does exactly that :P
Are there any concerns with that, or is this perfectly fine?
That should work. We often specify a "test" source of randomness to make the tests faster but we really shouldn't be doing that in examples.
Also, we should probably use a 2048 bit key (instead of 1024 bits). Every time we use 1024, we should explicitly say "not safe for production use".
from go-ipns.
Happy to propose a PR with the above if that’s good, but it would be nice if we could do the key generation without relying on two other packages.
from go-ipns.
Well, we don't really need go-ipfs-util (can use crypto/rand.Reader
). However, key generation is a separate concern so will probably require the additional import.
from go-ipns.
we don't really need go-ipfs-util (can use crypto/rand.Reader)
Oh, I just looked and realized libp2p-crypto already has GenerateKeyPair()
, which does exactly that :P
Are there any concerns with that, or is this perfectly fine?
privateKey, publicKey, err := crypto.GenerateKeyPair(crypto.RSA, 1024)
However, key generation is a separate concern so will probably require the additional import.
Oh, d'oh, I guess it has to be a Libp2p PrivKey
, so you can’t really get away from that requirement. Boo to me for not looking that up first. 👍
from go-ipns.
Related Issues (10)
- Consider renaming to go-ipns-record HOT 2
- Background Concepts and Definitions HOT 5
- IPNS directories being empty after new file being added HOT 4
- Needs Review HOT 8
- Not compatible while using github.com/ipfs/go-ipfs/namesys HOT 2
- stop using peer.IDFromString HOT 2
- How to generate IPNS Hash from *pb.IpnsEntry as according to `ipfs name publish .....` HOT 5
- Add a repo description HOT 1
- Add an example HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-ipns.