Code example for KeyStore

Methods: store

0
 
  private void store(KeyStore keyStore) {
    try { 
      FileOutputStream fos =
          mContext.openFileOutput(KEYSTORE_FILENAME, Context.MODE_PRIVATE);
      keyStore.store(fos, KEYSTORE_PASSWORD);
      fos.close();
    } catch (IOException e) {
      throw new IllegalStateException("Unable to store keyStore", e);
    } catch (GeneralSecurityException e) {
      throw new IllegalStateException("Unable to store keyStore", e);
    } 
  } 
 
  /** 
   * Stores current state of key store. 
   */ 
  public synchronized void store() { 
    store(mKeyStore);
  }