generate public key from pk8 file

I have a pk8 file with private key (ecc256) , I need to get the public key. I tried to look over the web, and i found some openssl forums discussing pem files I didnt find about pk8


found a way: first convert .pk8 to pem :

openssl pkcs8 -in keys.pk8 -inform DER  -out prv.pem

then, convert prv.pem to pub.pem:

openssl ec -in prv.pem -pubout -out pub.pem