 +        "signature": attr.label(
 +            mandatory = True,
 +            allow_single_file = True,
-+            doc = "The sha256 digest of the sigstruct signed by the " +
-+                  "RSA-3072 private key with public exponent 3.",
++            doc = "The sha256 digest of the enclave signing material signed " +
++                  "by the RSA-3072 private key with public exponent 3.",
 +        ),
-+        "sigstruct": attr.label(
++        "signing_material": attr.label(
 +            mandatory = True,
 +            allow_single_file = True,
 +            providers = [SGXSigstructInfo],
-+            doc = ("The label of a sgx_generate_sigstruct target that " +
++            doc = ("The label of a sgx_generate_enclave_signing_material target that " +
 +                   "includes both the unsigned enclave and its config."),
 +        ),
 +        "_sign_tool": attr.label(

+            config,
+            ctx.file.public_key,
+            ctx.file.signature,
+            ctx.file.sigstruct,
+            unsigned_file,
+        ],
+        tools = [ctx.executable._sign_tool],

+            "-config",
+            config.path,
+            "-unsigned",
+            ctx.file.signing_material.path,
+            "-out",
+            ctx.outputs.executable.path,
+        ],
