Code example for PrivateKey

Methods: getEncoded

0
    private static void dumpKeyPair(KeyPair keyPair) {
        PublicKey pub = keyPair.getPublic();
        Log.i("Public Key:", getHexString(pub.getEncoded()));
 
        PrivateKey priv = keyPair.getPrivate();
        Log.i("Private Key", getHexString(priv.getEncoded()));
    } 
     
    public static boolean existsKeyPair() { 
        return (new File(privatePath())).exists();
    } 
 
    public static String privatePath() {
        return FILE_PATH + SECRET_KEY;
    } 
 
    public static String publicPath() {
        return FILE_PATH + PUBLIC_KEY;
    } 
     
    private static String getHexString(byte[] b) {