1 /* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.tradefed.util.keystore; 18 19 /** 20 * Interface to access a key store for password or sensitive data. 21 */ 22 public interface IKeyStoreClient { 23 24 /** 25 * A method to check whether or not we have a valid key store to talk to. 26 * 27 * @return true if we have a valid key store, false otherwise. 28 */ isAvailable()29 public boolean isAvailable(); 30 31 /** 32 * A method to check if the key store contains a given key. 33 * 34 * @param key to check existence for. 35 * @return true if the given key exists. 36 */ containsKey(String key)37 public boolean containsKey(String key); 38 39 /** 40 * A method to fetch a given key inside the key store. 41 * 42 * @param key to fetch inside the key store. 43 * @return the {@link String} value of the key. It will return null if key 44 * is not found. 45 */ fetchKey(String key)46 public String fetchKey(String key); 47 48 } 49