Is it possible to export the public key from a keystore for a specific user id without needing the keystore password? Everything I tried requires I specify the user id and password when instantiating a KeyStore object like this:
KeyStore keyStore = new KeyStore("some_user_id", "some_password");
string publicKey = keyStore.ExportPublicKeyAsString("some_user_id");
It would be nice to have another overloaded constructor that takes a single argument: userId so I can do this:
KeyStore keyStore = new KeyStore("some_user_id");
This object would have limited capabilites and could only do things like export the public key. If I tried to decrypt with this keyStore instance or export the private key it would throw an exception about needing the password.
My goal is to allow apps/senders to retrieve the public key from a keystore using only the userid so they can encrypt messages without needing the password. Giving the keystore password to the apps/senders is obviously a security risk.