byte[] readFromSecretStore(String filename,String dataType,AMPassword password) throws Exception {
  byte[] cryptoData=null;
  File file=new File(filename);
  FileInputStream fis=new FileInputStream(file);
  KeyStore store=KeyStore.getInstance("jceks");
  store.load(fis,password.getChars());
  fis.close();
  KeyStore.ProtectionParameter params=new KeyStore.PasswordProtection(password.getChars());
  KeyStore.SecretKeyEntry keyentry=(KeyStore.SecretKeyEntry)store.getEntry(dataType,params);
  if (keyentry != null) {
    SecretKey sdata=keyentry.getSecretKey();
    cryptoData=(byte[])sdata.getEncoded();
  }
  return cryptoData;
}

byte [ ] readFromSecretStore ( String filename , String dataType , AMPassword password ) throws Exception { byte [ ] cryptoData = null ; File file = new File ( filename ) ; FileInputStream fis = new FileInputStream ( file ) ; KeyStore store = KeyStore . getInstance ( "jceks" ) ; store . load ( fis , password . getChars ( ) ) ; fis . close ( ) ; KeyStore . ProtectionParameter params = new KeyStore . PasswordProtection ( password . getChars ( ) ) ; KeyStore . SecretKeyEntry keyentry = ( KeyStore . SecretKeyEntry ) store . getEntry ( dataType , params ) ; if ( keyentry != null ) { SecretKey sdata = keyentry . getSecretKey ( ) ; cryptoData = ( byte [ ] ) sdata . getEncoded ( ) ; } return cryptoData ; }
returns matched secret data from from the secret storage . at a time there are only 3 things in logger ' s secure store file - initialkey , currentkey and current signature in the verifier secure store file there is just the initial key of the logger and the currentkey
