presto-main/src/main/java/io/prestosql/server/security/JsonWebTokenAuthenticator.java/JsonWebTokenAuthenticator/loadKeyFile
class JsonWebTokenAuthenticator:    private static LoadedKey loadKeyFile(File file)
    {
        if (!file.canRead()) {
            throw new SignatureException("Unknown signing key ID");
        }

        String data;
        try {
            data = asCharSource(file, US_ASCII).read();
        }
        catch (IOException e) {
            throw new SignatureException("Unable to read signing key", e);
        }

        // try to load the key as a PEM encoded public key
        if (PemReader.isPem(data)) {
            try {
                return new LoadedKey(PemReader.loadPublicKey(data));
            }
            catch (RuntimeException | GeneralSecurityException e) {
                throw new SignatureException("Unable to decode PEM signing key id", e);
            }
        }

        // try to load the key as a base64 encoded HMAC key
        try {
            byte[] rawKey = getMimeDecoder().decode(data.getBytes(US_ASCII));
            return new LoadedKey(rawKey);
        }
        catch (RuntimeException e) {
            throw new SignatureException("Unable to decode HMAC signing key", e);
        }
    }