List of usage examples for android.security KeyChain getPrivateKey
@Nullable @WorkerThread public static PrivateKey getPrivateKey(@NonNull Context context, @NonNull String alias) throws KeyChainException, InterruptedException
From source file:org.strongswan.android.logic.CharonVpnService.java
/** * Function called via JNI to get the private key the user selected. * * Since this method is called from a thread of charon's thread pool we are safe * to call methods on KeyChain directly. * * @return the private key/*ww w . j a va 2 s. c o m*/ * @throws InterruptedException * @throws KeyChainException * @throws CertificateEncodingException */ private PrivateKey getUserKey() throws KeyChainException, InterruptedException { return KeyChain.getPrivateKey(getApplicationContext(), mCurrentUserCertificateAlias); }