From Google samples: https://developer.android.com/samples/BasicAndroidKeyStore/index.html