public void storePairingFile(File outputFile,String devicename,char[] password,PairingType type,DeviceType devType){
  logger.debug("PanboxClient : storePairingFile : Storing pairing container to: " + outputFile.getAbsolutePath());
  try {
    PanboxFilePairingWriteReturnContainer retCon=null;
    if (type == PairingType.MASTER) {
      retCon=PanboxFilePairingUtils.storePairingFile(outputFile,devicename,password,type,devType,myId.getEmail(),myId.getFirstName(),myId.getName(),myId.getPrivateKeyEnc(password),myId.getCertEnc(),myId.getPrivateKeySign(password),myId.getCertSign(),getDevicePairingMap(),getContactsPairingList());
    }
 else {
      retCon=PanboxFilePairingUtils.storePairingFile(outputFile,devicename,password,type,devType,myId.getEmail(),myId.getFirstName(),myId.getName(),null,myId.getCertEnc(),null,myId.getCertSign(),getDevicePairingMap(),getContactsPairingList());
    }
    logger.debug("PanboxClient : storePairingFile : Storing pairing container finished.");
    deviceManager.addDevice(retCon.getDevicename(),retCon.getDevCert(),retCon.getDevType());
    refreshDeviceListModel();
  }
 catch (  IOException|KeyStoreException|NoSuchAlgorithmException|CertificateException ex) {
    logger.error("PanboxClient : storePairingFile : Exception caught: ",ex);
    JOptionPane.showMessageDialog(null,bundle.getString("PanboxClient.errorWhileStoringPairingContainer"),bundle.getString("PanboxClient.errorWhileStoringPairingContainer"),JOptionPane.ERROR_MESSAGE);
  }
catch (  UnrecoverableKeyException ex) {
    logger.error("PanboxClient : storePairingFile : Wrong password: ",ex);
    JOptionPane.showMessageDialog(null,bundle.getString("PanboxClient.wrongPassword"),bundle.getString("PanboxClient.errorWhileStoringPairingContainer"),JOptionPane.ERROR_MESSAGE);
  }
catch (  DeviceManagerException ex) {
    logger.warn("PanboxClient : storePairingFile : Exception caught after pairing file: ",ex);
    JOptionPane.showMessageDialog(null,bundle.getString("PanboxClient.errorCouldNotAddDevicePairing"),bundle.getString("PanboxClient.errorCouldNotAddDevicePairingTitle"),JOptionPane.ERROR_MESSAGE);
  }
}

public void storePairingFile ( File outputFile , String devicename , char [ ] password , PairingType type , DeviceType devType ) { logger . debug ( "PanboxClient : storePairingFile : Storing pairing container to: " + outputFile . getAbsolutePath ( ) ) ; try { PanboxFilePairingWriteReturnContainer retCon = null ; if ( type == PairingType . MASTER ) { retCon = PanboxFilePairingUtils . storePairingFile ( outputFile , devicename , password , type , devType , myId . getEmail ( ) , myId . getFirstName ( ) , myId . getName ( ) , myId . getPrivateKeyEnc ( password ) , myId . getCertEnc ( ) , myId . getPrivateKeySign ( password ) , myId . getCertSign ( ) , getDevicePairingMap ( ) , getContactsPairingList ( ) ) ; } else { retCon = PanboxFilePairingUtils . storePairingFile ( outputFile , devicename , password , type , devType , myId . getEmail ( ) , myId . getFirstName ( ) , myId . getName ( ) , null , myId . getCertEnc ( ) , null , myId . getCertSign ( ) , getDevicePairingMap ( ) , getContactsPairingList ( ) ) ; } logger . debug ( "PanboxClient : storePairingFile : Storing pairing container finished." ) ; deviceManager . addDevice ( retCon . getDevicename ( ) , retCon . getDevCert ( ) , retCon . getDevType ( ) ) ; refreshDeviceListModel ( ) ; } catch ( IOException | KeyStoreException | NoSuchAlgorithmException | CertificateException ex ) { logger . error ( "PanboxClient : storePairingFile : Exception caught: " , ex ) ; JOptionPane . showMessageDialog ( null , bundle . getString ( "PanboxClient.errorWhileStoringPairingContainer" ) , bundle . getString ( "PanboxClient.errorWhileStoringPairingContainer" ) , JOptionPane . ERROR_MESSAGE ) ; } catch ( UnrecoverableKeyException ex ) { logger . error ( "PanboxClient : storePairingFile : Wrong password: " , ex ) ; JOptionPane . showMessageDialog ( null , bundle . getString ( "PanboxClient.wrongPassword" ) , bundle . getString ( "PanboxClient.errorWhileStoringPairingContainer" ) , JOptionPane . ERROR_MESSAGE ) ; } catch ( DeviceManagerException ex ) { logger . warn ( "PanboxClient : storePairingFile : Exception caught after pairing file: " , ex ) ; JOptionPane . showMessageDialog ( null , bundle . getString ( "PanboxClient.errorCouldNotAddDevicePairing" ) , bundle . getString ( "PanboxClient.errorCouldNotAddDevicePairingTitle" ) , JOptionPane . ERROR_MESSAGE ) ; } }
stores a pairing file at the specified path for the specified device and type
