private static char[] keystorePassword(final String password) {
        if (password == null) {
            return new char[0];
        } else {
            return password.toCharArray();
        }
    }
Loads the {@link KeyStore} from the given {@link Resource}.

@param keyStoreFormat The format of the keystore.
@param keyStore The resource containing the keystore.
@param keyStorePassword The password for the keystore. May be empty or null.
@return The newly created KeyStore.
@throws KeyStoreException If the keystore format isn't supported.
@throws IOException If there is an I/O or format problem with the keystore data, if a password is required but
        not given, or if the given password was incorrect. If the error is due to a wrong password, the
        {@link Throwable#getCause cause} of the {@code IOException} should be an
        {@code UnrecoverableKeyException}
@throws NoSuchAlgorithmException If the algorithm used to check the integrity of the keystore cannot be found
@throws CertificateException If any of the certificates in the keystore could not be loaded
grpc-common-spring-boot/src/main/java/net/devh/boot/grpc/common/security/KeyStoreUtils.java