Code example for X509Certificate

Methods: getSubjectDN

0
                PINLIST_CERTIFICATE_KEY);
        if (cert == null || overwrite) {
            X509Certificate c = createCertificate();
            Log.d(TAG, "Trying to put pin list signing certificate in "
                    + PINLIST_CERTIFICATE_KEY + ": "
                    + c.getSubjectDN().getName());
            putCertificate(); 
        } 
        Log.d(TAG, PINLIST_CERTIFICATE_KEY + "= " + cert);
    } 
 
    public String getNextVersion() throws Exception {
        int currentVersion = Integer.parseInt(readCurrentVersion());
        return Integer.toString(currentVersion + 1);
    } 
 
    // cannot read w/ default perms. Use su 
    private String readCurrentVersion() throws Exception {
        String metadataFilename = "/data/misc/keychain/metadata/version";
        if (SuShell.canGainSu(ctx)) {
            List<String> result = SuShell.runWithSu("ls " + metadataFilename);