How to import .p12 file via SmartCardShell or command line?

Following steps done .pem encoded private key and cert to .p12 file :

Step-1 : keys cat private.pem cert.pem >cert-private.pem

Step-2 keys openssl pkcs12 -export -in cert-private.pem -out certificated-key.p12 -passout pass:mypassword

Now, how import the certificated-key.p12 at the Tool SmartCardShell ? (DKEK already created with n-to-m way)

or

via command line e.g. sc-hsm-tool /openssl etc

Check Nitrokey HSM 2: Import existing private and public keys for ECDSA and Importing Keys and Certificates — Nitrokey Documentation

In most cases it is better to generate the key on the HSM and not externally. That is what HSMs are for.

All Right @saper , I followed the above -

step-no.5 is not with the details (means sub-steps) 5. import the certificated-key.p12 at the Tool SmartCardShell. (I got those steps from a separate thread) will update here

Follow up Qs :

#1. Consider a case it got imported then how to export it back to original

#2.Also once created keys internally, then how an application can use that? for that, do I need to write some programs? Or it can be exported as plain key ?