Example #1
0
    def __init__(self, argv):
        Command.__init__(self, argv, "", "x", allowArgRemainder=True)

        if len(self.argRemainder) < 1:
            self.printError("Missing argument: file to view")
        if len(self.argRemainder) > 1:
            self.printError("Can only view one file")
Example #2
0
    def __init__(self, argv):
        Command.__init__(self, argv, "", "")

        if len(argv) < 1:
            self.printError("Missing argument: file to view")
        if len(argv) > 1:
            self.printError("Can only view one file")
Example #3
0
    def __init__(self, argv):
        Command.__init__(self, argv, "", "")

        if len(argv) < 1:
            self.printError("Missing argument: file to view")
        if len(argv) > 1:
            self.printError("Can only view one file")
Example #4
0
    def __init__(self, argv):
        Command.__init__(self, argv, "oib", "v")

        self.outputFile, self.outputFileName = self.getOutputFile()
        self.inputTack = self._getInputTack()
        self.inputCertificate = self._getInputCertificate()
        self.breakSignatures = self._getBreakSignatures()

        if self.inputTack is None and self.inputCertificate is None:
            self.printError("-i missing")
Example #5
0
    def __init__(self, argv):
        Command.__init__(self, argv, "", "")

        if len(argv) < 1:
            HelpCommand.printGeneralUsage()

        self.command = argv[0]

        if not self.command in HelpCommand.COMMANDS:
            self.printError("%s not a valid command." % self.command)
Example #6
0
    def __init__(self, argv):
        Command.__init__(self, argv, "", "", allowArgRemainder=True)

        if len(self.argRemainder) < 1 or len(self.argRemainder)>1:
            HelpCommand.printGeneralUsage()

        self.command = self.argRemainder[0]

        if not self.command in HelpCommand.COMMANDS:
            self.printError("%s not a valid command." % self.command)
Example #7
0
    def __init__(self, argv):
        Command.__init__(self, argv, "", "")

        if len(argv) < 1:
            HelpCommand.printGeneralUsage()

        self.command = argv[0]

        if not self.command in HelpCommand.COMMANDS:
            self.printError("%s not a valid command." % self.command)
Example #8
0
    def __init__(self, argv):
        Command.__init__(self, argv, "", "", allowArgRemainder=-1)

        if len(self.argRemainder) < 1 or len(self.argRemainder) > 1:
            HelpCommand.printGeneralUsage()

        self.command = self.argRemainder[0]

        if not self.command in HelpCommand.COMMANDS:
            self.printError("%s not a valid command." % self.command)
Example #9
0
    def __init__(self, argv):
        Command.__init__(self, argv, "oib", "v")

        self.outputFile, self.outputFileName = self.getOutputFile()
        self.inputTack = self._getInputTack()
        self.inputCertificate = self._getInputCertificate()
        self.breakSignatures = self._getBreakSignatures()

        if self.inputTack is None and self.inputCertificate is None:
            self.printError("-i missing")
Example #10
0
    def __init__(self, argv):
        Command.__init__(self, argv, "kcopmgen", "v")

        self.password                        = self.getPassword()
        self.outputFile, self.outputFileName = self.getOutputFile()
        self.key                             = self.getKey(self.password)

        self.certificate                     = self._getCertificate()
        self.generation                      = self._getGeneration()
        self.min_generation                  = self._getMinGeneration()
        self.expiration                      = self._getExpiration()
        self.numArg                          = self._getTackCount()
Example #11
0
    def __init__(self, argv):
        Command.__init__(self, argv, "kcopmgen", "v")

        self.password = self.getPassword()
        self.outputFile, self.outputFileName = self.getOutputFile()
        self.key = self.getKey(self.password)

        self.certificate = self._getCertificate()
        self.generation = self._getGeneration()
        self.min_generation = self._getMinGeneration()
        self.expiration = self._getExpiration()
        self.numArg = self._getTackCount()
Example #12
0
    def __init__(self, argv):
        Command.__init__(self, argv, "kcopmgen", "vx")
        self.password                        = self.getPassword()
        self.keyfile                         = self.getKeyFile(self.password, mandatory=True)

        self.certificate                     = self.getCertificate(mandatory=True)
        self.generation                      = self._getGeneration()
        self.min_generation                  = self._getMinGeneration()
        self.expiration                      = self._getExpiration(self.certificate)
        self.numArg                          = self._getNumArg()
        # If -n, then -o is a filename prefix only, so is not opened
        if self.numArg:
            self.outputFileName              = self.getOutputFileName()
            return
        self.outputFile, self.outputFileName = self.getOutputFile()
Example #13
0
    def __init__(self, argv):
        Command.__init__(self, argv, "kcopmgen", "vx")
        self.password = self.getPassword()
        self.keyfile = self.getKeyFile(self.password, mandatory=True)

        self.certificate = self.getCertificate(mandatory=True)
        self.generation = self._getGeneration()
        self.min_generation = self._getMinGeneration()
        self.expiration = self._getExpiration(self.certificate)
        self.numArg = self._getNumArg()
        # If -n, then -o is a filename prefix only, so is not opened
        if self.numArg:
            self.outputFileName = self.getOutputFileName()
            return
        self.outputFile, self.outputFileName = self.getOutputFile()
Example #14
0
    def printGeneralUsage(message=None):
        if message:
            print("Error: %s\n" % message)
        sys.stdout.write("""tack.py version %s (%s)

Commands (use "help <command>" to see optional args):
  genkey
  sign     -k KEY -c CERT
  view     FILE
  help     COMMAND
("pack" and "unpack" are advanced commands for debugging)
""" % (__version__, Command.getCryptoVersion()))
        sys.exit(-1)
Example #15
0
    def printGeneralUsage(message=None):
        if message:
            print ("Error: %s\n" % message)
        sys.stdout.write(
"""tack.py version %s (%s)

Commands (use "help <command>" to see optional args):
  genkey
  sign     -k KEY -c CERT
  view     FILE
  help     COMMAND
("pack" and "unpack" are advanced commands for debugging)
""" % (__version__, Command.getCryptoVersion()))
        sys.exit(-1)
Example #16
0
 def __init__(self, argv):
     Command.__init__(self, argv, "o", "vx", 1)
     self.outputFile, self.outputFileName = self.getOutputFile()
     self.tackExtension = self.getTackExtension(extenderFormat=True)
Example #17
0
 def __init__(self, argv):
     Command.__init__(self, argv, "oE", "vx")
     self.outputFile, self.outputFileName = self.getOutputFile()
     self.tackExtension = self.getTackExtension(mandatory=True)
Example #18
0
 def __init__(self, argv):
     Command.__init__(self, argv, "", "x", allowArgRemainder=True)
     if len(self.argRemainder) < 1:
         self.printError("Missing argument: file to view")
     if len(self.argRemainder) > 1:
         self.printError("Can only view one file")
Example #19
0
 def __init__(self, argv):
     Command.__init__(self, argv, "pok", "v")
     self.password                        = self.getPassword()
     self.outputFile, self.outputFileName = self.getOutputFile()
     self.key                             = self.getKey(self.getPassword())
Example #20
0
 def __init__(self, argv):
     Command.__init__(self, argv, "po", "v")
     self.password = self.getPassword()
     self.outputFile, self.outputFileName = self.getOutputFile()
Example #21
0
 def __init__(self, argv):
     Command.__init__(self, argv, "ota", "vx")
     self.outputFile, self.outputFileName = self.getOutputFile()
     self.tacks = self.getTacks()
     self.activationFlags = self._getActivationFlags()
Example #22
0
 def __init__(self, argv):
     Command.__init__(self, argv, "oa", "vx", 1)
     self.outputFile, self.outputFileName = self.getOutputFile()
     self.tacks = self.getTacks()
     self.activationFlags = self._getActivationFlags()
Example #23
0
 def __init__(self, argv):
     Command.__init__(self, argv, "o", "vx", 1)
     self.outputFile, self.outputFileName = self.getOutputFile()
     self.tackExtension = self.getTackExtension(extenderFormat=True)
Example #24
0
    def __init__(self, argv):
        Command.__init__(self, argv, "oib", "v")

        self.outputFile, self.outputFileName = self.getOutputFile()
        (self.inputTack, self.inputCertificate) = self._getInputFile()
        self.breakSignatures                 = self._getBreakSignatures()
Example #25
0
 def __init__(self, argv):
     Command.__init__(self, argv, "oE", "vx")
     self.outputFile, self.outputFileName = self.getOutputFile()
     self.tackExtension = self.getTackExtension(mandatory=True)