<?xml version="1.0" encoding="iso-8859-1"?>
<job id="ListContent">
<script language="JScript" src="../QJScriptLib/log.js"/>
<script language="JScript" src="../QJScriptLib/execute.js"/>
<script language="JScript" src="../QJscriptLib/msconst.js"/>
<script language="JScript" src="../QJscriptLib/FileSystem.js"/>
<script language="JScript" src="../QJscriptLib/QCAPICOM.js"/>
<script language="JScript"><![CDATA[

var MSC = new MSCO ();
Main ();

function Main () {
    var enumFiles;
    var arrFiles;

    if (WScript.Arguments.length != 4) {
        WScript.Echo ("Qumeanet (R) CDSigner Version 1.0");
        WScript.Echo ("");
        WScript.Echo ("Usage: CDSigner.wsf <RootDir> <HashesFilename> <SigningCertSubject> <TrustStore>");
        WScript.Echo ("     RootDir - root directory in which the files we want to create hases for, resides.");
        WScript.Echo ("     HashesFilename - name of new hases file to create");
        WScript.Echo ("     SigningCertSubject - name of signing certificate. certificate (and private key) must reside in the user certificate store");
        WScript.Echo ("     TrustStore - name of trust store with which we want to check hashes");
        
        WScript.Quit(1);
    }
    CreateHashes (WScript.Arguments(1),WScript.Arguments(2),WScript.Arguments(0));
    
    if (!VerifyFilesExistance(WScript.Arguments(1),WScript.Arguments(0))) {
        WScript.Echo ("Not All Files exists");
    }

    if (
    	!VerifyHashes (
    		WScript.Arguments(1),
    		WScript.Arguments(3),
    		"123456",
    		WScript.Arguments(0)
    	)
    ) {
        WScript.Echo ("Not all hashes are valid");
    }


    WScript.Echo ("CDSigner - Hashes file created and verified successfully");
}

]]>
</script>
</job>
