Comments (7)
Yes, that should be possible. In rsa.js there would be a need to provide a new function
set_rsa_public_key = function(ctx,n,e)
similar to the existing
rsa_public_key = function(ctx)
Where the public key n is provided as a byte array extracted from an X.509 cert, and e=65537. Then use the ff.js function
FF.fromBytes = function(x, b)
to copy n into the public key structure.
(Note: we would regard X.509 cert processing as outside of the remit of this library)
from core.
Ok. Thank you!
Pascal
from core.
I am not sure, if that is wished, but maybe it could be useful to have getter and setter for the objects rsa_public_key
and rsa_private_key
. In the following is a suggestion how it could be done:
ctx.rsa_public_key.set(n,e);
ctx.rsa_public_key.set_e(e);
ctx.rsa_public_key.set_n(n);
ctx.rsa_public_key.get_instance(n,e);
Whereby the get_instance method creates a new rsa_public_key object and set the properties n
and e
.
It is also possible to do respectively also getter and setter for the rsa_private_key
and a get_instance method for setting the attributes manually.
What do you think about the idea?
Maybe that would be better as creating a "new" rsa_public_key object and it is possible to use the existing structure.
If you want I can create a Pull Request, depends on if you think that could be useful for the library.
from core.
Yes, OK, that sounds like a good plan. Make sure and test it on a real X.509 public key!
Mike
from core.
It seems that it is possible to store a public key in that structure.
I used [1] as asn1 parser and stored the bytes directly into the rsa_public_key structure with the get_instance method.
Pull Request is on the way - without the asn1 parser, only the rsa key data strucutres.
Anyway I have a question regarding the data in the array which I get back from the FF data structure.
Which representation have the content of the following array?
[ 190, 66, 142, 139, 46, 151, 187, 158, 173, 174, 147, 123, ... ]
is the the 190 (from index 0) in hex or in uint or something else? I am a bit confused about the representation and wanted to know which representation are used here.
Thank you in advance!
[1] https://git.coolaj86.com/coolaj86/asn1-parser.js
from core.
Those are just unsigned byte values, in decimal
from core.
Thank you.
from core.
Related Issues (20)
- JS library doesn't compile HOT 1
- BLS: bug in Rust implementation? HOT 3
- ECP::muln() bug? HOT 2
- Bug with BIG.mod in Java? HOT 2
- ECP2 multiply by FP in golang? HOT 15
- G2mul for ECP? (Golang) HOT 3
- golang: Signature Recover function using FP, ECP
- core/python could be structured more like a Python module HOT 2
- Javascript ecp2 toBytes functions gives not the same bytes as in the Java implementation HOT 5
- FP256BN Plus and math.MaxInt64
- feature request: addition of AES-CTR (and optionally, SIV-AES) HOT 2
- Reporting security issues HOT 2
- BLS12-381 Signature Aggregation HOT 3
- Is `ECP::mapit` a good random oracle? HOT 4
- secp256r1 HOT 2
- Support go modules HOT 3
- Pairing Example with JS
- select indepentent generator with node js HOT 1
- Attack against M-PIN HOT 4
- core/java: ECP compression 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 core.