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

publicKeyXBase64 and publicKeyYBase64 are nil #31

Open
deepesh-vasthimal-cko opened this issue Jul 1, 2020 · 0 comments
Open

publicKeyXBase64 and publicKeyYBase64 are nil #31

deepesh-vasthimal-cko opened this issue Jul 1, 2020 · 0 comments

Comments

@deepesh-vasthimal-cko
Copy link

Hi all ,

I am getting nil values when accessing publicKeyXBase64 and publicKeyYBase64 of the generateKeyPair. See below code example for reference.

only after I access publicKeyBase64 once I am able to then retrieve publicKeyXBase64 and publicKeyYBase64, Seems to be a bit weird is there a dependency between accessing publicKeyBase64 and generating publicKeyXBase64 and publicKeyYBase64 values ? . Please help and suggest.


        let testEC = GMEllipticCurveCrypto.generateKeyPair(for: GMEllipticCurveSecp256r1)
        testEC?.compressedPublicKey = false
        
        print(testEC?.publicKeyXBase64) // nil
        print(testEC?.publicKeyYBase64) // nil
        
        print(testEC?.privateKeyBase64) // Optional("A91MmkAlqO3CQYYUujwxpn0fSCH4vFX1bMcUgAQ7aB4=")
        let publicKeyBase64 = testEC?.publicKeyBase64 // only after accessing publicKeyBase64 once I get below x and y values
        
        print(testEC?.publicKeyXBase64) // Optional("GsKdKK0HUN8MhaNZtZwB3hdSOizpPlwkUF2h8uppiZQ=")
        print(testEC?.publicKeyYBase64) // Optional("RAq/+6/L7q/JqTO3QRO+Kft5xuku0dTKYE3gdDYvxOA=")

        

Thanks
Deepesh

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

No branches or pull requests

1 participant