fun loadOrCreateKeyPairFromKeyStore(keyStoreFilePath: Path, storePassword: String, keyPassword: String, alias: String, keyGenerator: () -> CACertAndKey): KeyPair
Extract public and private keys from a KeyStore file assuming storage alias is known, or create a new pair of keys using the provided function if the keys not exist.
keyStoreFilePath
- Path to load KeyStore fromstorePassword
- Password to unlock the KeyStorekeyPassword
- Password to unlock the private key entriesalias
- The name to lookup the Key and Certificate chain fromkeyGenerator
- Function for generating new keysReturn
The KeyPair found in the KeyStore under the specified alias