agens-no / EllipticCurveKeyPair

Sign, verify, encrypt and decrypt using the Secure Enclave
Other
708 stars 114 forks source link

Generate public key with standard curve 'secp256r1'(NIST Curve P-256 ) #34

Open hamedaakhlaghi opened 5 years ago

hamedaakhlaghi commented 5 years ago

How can I generate a public key with specific domain parameters (a, b, p, x, y, n, h) according to secp256r1

hfossli commented 5 years ago

I have not done that before. Do you want to do that whilst storing the private key on secure enclave? I don't think that is possible.

You could create a key pair outside of the sdk and import the public key to the sdk. I can help you with importing.

hamedaakhlaghi commented 5 years ago

I saw secp256r1 in the readme, I thought your library support this standard. I don't want to store public or private, I need to generate public key with secp256r1.

hfossli commented 5 years ago

Yes, it supports the same configuration for secp256r1 as Security framework from Apple provides of support. I don't think I can help you further than that. Maybe if you share some pseudo code?

Sajjon commented 5 years ago

@hamedaakhlaghi I support secp256r1 in EllipticCurveKit

hamedaakhlaghi commented 5 years ago

@Sajjon Thanks, My problem resolved

hfossli commented 5 years ago

How did you resolve?

hamedaakhlaghi commented 5 years ago

@hfossli I used https://github.com/ricmoo/GMEllipticCurveCrypto framework.