Code example for KeyStore

Methods: containsAlias

0
     *  
     * @return true, if certificate is available. 
     */ 
    private boolean hasLocalIdentityAlias() { 
        try { 
            if (!mKeyStore.containsAlias(LOCAL_IDENTITY_ALIAS)) {
                Log.e(LOG_TAG, "Key store missing identity for " + LOCAL_IDENTITY_ALIAS);
                return false; 
            } 
        } catch (KeyStoreException e) {
            Log.e(LOG_TAG, "Key store exception occurred", e);
            return false; 
        } 
        return true; 
    } 
 
    /** 
     * Loads or otherwise creates keys for application. This call may take 
     * substantial amount of time to complete. 
     *  
     * @param context Context of the Application