Ejemplo n.º 1
0
    def create_order_from_config(self, use_expiration=False):
        """Creates order from configuration."""
        expiration = None
        if use_expiration:
            expiration = time.get_tomorrow_timestamp()

        resp = self.create_order(
            name=self.config.name,
            payload_content_type=self.config.payload_content_type,
            algorithm=self.config.algorithm,
            bit_length=self.config.bit_length,
            mode=self.config.mode,
            expiration=expiration)
        return resp
Ejemplo n.º 2
0
    def create_order_from_config(self, use_expiration=False):
        """Creates order from configuration."""
        expiration = None
        if use_expiration:
            expiration = time.get_tomorrow_timestamp()

        resp = self.create_order(
            name=self.config.name,
            payload_content_type=self.config.payload_content_type,
            algorithm=self.config.algorithm,
            bit_length=self.config.bit_length,
            mode=self.config.mode,
            expiration=expiration)
        return resp
Ejemplo n.º 3
0
    def create_secret_from_config(self, use_expiration=True,
                                  use_plain_text=True):
        expiration = None
        data = None
        if use_expiration:
            expiration = time.get_tomorrow_timestamp()
        if use_plain_text:
            data = self.config.plain_text

        resp = self.create_secret(
            name=self.config.name,
            expiration=expiration,
            algorithm=self.config.algorithm,
            bit_length=self.config.bit_length,
            cypher_type=self.config.cypher_type,
            plain_text=data,
            mime_type=self.config.mime_type)
        return resp
Ejemplo n.º 4
0
    def create_secret_from_config(self, use_expiration=True, use_payload=True):
        expiration = None
        data = None
        if use_expiration:
            expiration = time.get_tomorrow_timestamp()
        if use_payload:
            data = self.config.payload

        resp = self.create_secret(
            name=self.config.name,
            expiration=expiration,
            algorithm=self.config.algorithm,
            bit_length=self.config.bit_length,
            mode=self.config.mode,
            payload=data,
            payload_content_type=self.config.payload_content_type,
            payload_content_encoding=self.config.payload_content_encoding)
        return resp
Ejemplo n.º 5
0
    def create_secret_from_config(self, use_expiration=True,
                                  use_payload=True):
        expiration = None
        data = None
        if use_expiration:
            expiration = time.get_tomorrow_timestamp()
        if use_payload:
            data = self.config.payload

        resp = self.create_secret(
            name=self.config.name,
            expiration=expiration,
            algorithm=self.config.algorithm,
            bit_length=self.config.bit_length,
            mode=self.config.mode,
            payload=data,
            payload_content_type=self.config.payload_content_type,
            payload_content_encoding=self.config.payload_content_encoding)
        return resp