Java tutorial
//package com.java2s; import java.security.KeyStore; import java.security.PublicKey; public class Main { public static PublicKey androidPubKey(KeyStore keyStore, String alias) { try { KeyStore.PrivateKeyEntry privateKeyEntry = (KeyStore.PrivateKeyEntry) keyStore.getEntry(alias, null); return privateKeyEntry.getCertificate().getPublicKey(); } catch (Exception expt) { expt.printStackTrace(); throw new RuntimeException(expt); } } }