Here you can find the source of getKey(InputStream is)
public static Key getKey(InputStream is)
//package com.java2s; //License from project: Apache License import java.io.InputStream; import java.io.ObjectInputStream; import java.security.Key; public class Main { public static Key getKey(InputStream is) { try {/*from w w w. j a v a 2s .c o m*/ ObjectInputStream ois = new ObjectInputStream(is); return (Key) ois.readObject(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); } } }