Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.security.KeyStore;

import java.security.PrivateKey;

public class Main {
    public static PrivateKey androidPrvKey(KeyStore keyStore, String alias) {
        try {
            KeyStore.PrivateKeyEntry privateKeyEntry = (KeyStore.PrivateKeyEntry) keyStore.getEntry(alias, null);
            return privateKeyEntry.getPrivateKey();
        } catch (Exception expt) {
            expt.printStackTrace();
            throw new RuntimeException(expt);
        }
    }
}