Closed Waleed1031 closed 1 year ago
Is this a question regarding OpenSSL's C API? This repository handles the openssl
library for Ruby.
Check out OpenSSL's GitHub page (https://github.com/openssl/openssl/) and the mailing lists (https://www.openssl.org/community/mailinglists.html).
Hi. I am working on Group Key Agreement using openssl. I am a bit weak in programming. So, needed a help. The issue is that i am deriving shared secret using following code.
`/ Generate shared secret / EVP_PKEY_CTX ctx; unsigned char skey; size_t skeylen; ctx = EVP_PKEY_CTX_new(pkey, NULL);
`
Now, i want to save this skey generated to some EVP structure so that i can use it as a peerkey while deriving shared secret with another client's keyshare. It is in raw form. i need a snippet which saves it in an EVP structure and save it in a file inn PEM format so that it can be used afterwards. I tried EVP_write_PrivateKey or Pubkey functions but they extract the private or public key from the context. An assistance will be appreciated. For clarification, i am using X25519 curve and ECDH for key agreement.
Thank you in advance.