def setUpClass(self): """Create and change into temporary directory, generate key pair and dummy material, read key pair. """ self.set_up_test_dir() self.step_name = "test_step" self.key_path = "test_key" generate_and_write_unencrypted_rsa_keypair(self.key_path) self.key = import_rsa_privatekey_from_file(self.key_path) self.key_pub = import_rsa_publickey_from_file(self.key_path + ".pub") self.test_artifact = "test_artifact" open(self.test_artifact, "w").close()
def setUpClass(self): """Create and change into temporary directory, generate key pair and dummy material, read key pair. """ self.set_up_test_dir() self.key_path = "test_key" generate_and_write_unencrypted_rsa_keypair(self.key_path) self.key = import_rsa_privatekey_from_file(self.key_path) self.step_name = "test_step" self.link_name_unfinished = UNFINISHED_FILENAME_FORMAT.format(step_name=self.step_name, keyid=self.key["keyid"]) self.test_material = "test_material" Path(self.test_material).touch()
def setUpClass(self): """Create and change into temporary directory, generate two key pairs and dummy product. """ self.set_up_test_dir() self.key_path = "test-key" self.key_path2 = "test-key2" generate_and_write_unencrypted_rsa_keypair(self.key_path) generate_and_write_unencrypted_rsa_keypair(self.key_path2) self.key = import_rsa_privatekey_from_file(self.key_path) self.key2 = import_rsa_privatekey_from_file(self.key_path2) self.step_name = "test-step" self.link_name = "{}.{:.8}.link".format(self.step_name, self.key["keyid"]) self.link_name_unfinished = UNFINISHED_FILENAME_FORMAT.format( step_name=self.step_name, keyid=self.key["keyid"]) self.test_product = "test_product" Path(self.test_product).touch()
def set_up_keys(cls): # Generated unencrypted keys cls.rsa_key_path = generate_and_write_unencrypted_rsa_keypair() cls.rsa_key_id = os.path.basename(cls.rsa_key_path) cls.ed25519_key_path = generate_and_write_unencrypted_ed25519_keypair() cls.ed25519_key_id = os.path.basename(cls.ed25519_key_path) # Generate encrypted keys cls.rsa_key_enc_path = generate_and_write_rsa_keypair(password=cls.key_pw) cls.rsa_key_enc_id = os.path.basename(cls.rsa_key_enc_path) cls.ed25519_key_enc_path = generate_and_write_ed25519_keypair(password=cls.key_pw) cls.ed25519_key_enc_id = os.path.basename(cls.ed25519_key_enc_path)