All Downloads are FREE. Search and download functionalities are using the official Maven repository.

in.s8.rsa.utility.ReadPrivateKey Maven / Gradle / Ivy

The newest version!
package in.s8.rsa.utility;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.ObjectInputStream;
import java.security.PrivateKey;

/**
 * Read the private key from file location.
 * 

* Created by Sourabh_Sethi on 5/17/2016. * * @author sourabh Sethi */ public class ReadPrivateKey { public PrivateKey readPrivateKeyPath(String privateKeyLocation) throws FileNotFoundException { ObjectInputStream inputStream = null; PrivateKey privateKey = null; try { inputStream = new ObjectInputStream(new FileInputStream(privateKeyLocation)); privateKey = (PrivateKey) inputStream.readObject(); } catch (FileNotFoundException e) { System.out.println("Please check the public key and Private Key Path"); System.out.println("please provide the private key path"); } catch (Exception e) { e.printStackTrace(); } return privateKey; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy