Ejemplo n.º 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")
Ejemplo n.º 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")
Ejemplo n.º 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")
Ejemplo n.º 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")
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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")
Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 17
0
 def __init__(self, argv):
     Command.__init__(self, argv, "oE", "vx")
     self.outputFile, self.outputFileName = self.getOutputFile()
     self.tackExtension = self.getTackExtension(mandatory=True)
Ejemplo n.º 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")
Ejemplo n.º 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())
Ejemplo n.º 20
0
 def __init__(self, argv):
     Command.__init__(self, argv, "po", "v")
     self.password = self.getPassword()
     self.outputFile, self.outputFileName = self.getOutputFile()
Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 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)
Ejemplo n.º 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()
Ejemplo n.º 25
0
 def __init__(self, argv):
     Command.__init__(self, argv, "oE", "vx")
     self.outputFile, self.outputFileName = self.getOutputFile()
     self.tackExtension = self.getTackExtension(mandatory=True)