Code example for PrivateKey

Methods: getAlgorithmgetFormat

0
        KeyFactory keyFactory
        = KeyFactory.getInstance("RSA");
        PrivateKey privateKey
        = keyFactory.generatePrivate(privateKeySpec);
         
        System.out.println("Loaded " + privateKey.getAlgorithm()
                   + " " + privateKey.getFormat()
                   + " private key."); 
        return privateKey;
    } finally { 
        // Dynamically deinstall the RSA provider  
        Security.removeProvider(provider.getName());
    } 
    } 
     
    /* ------------------------------------------------------------ */ 
    /** 
     * Show a usage message. 
     */ 
    static private void usage()