crypto: expose KeyObject class
This PR exposes the KeyObject class as per #26200 discussion.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
documentation is changed or added -
commit message follows commit guidelines
/cc @sam-github @tniessen
Closes #26200