---
title: "Tips and tricks"
slug: "tips-and-tricks"
updated: 2025-12-05T09:10:42Z
published: 2025-12-05T09:10:42Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.fortanix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tips and tricks

## 1. Decoding sigstruct

Example file: [sigstruct.bin](https://fortanix.atlassian.net/wiki/download/attachments/1215889477/sigstruct.bin?version=1&amp;modificationDate=1592252590269&amp;cacheVersion=1&amp;api=v2)

### a. Using CLI

```bash
$ em-cli build parse-sigstruct ./sigstruct.bin 
{
  "mrenclave": "53cc2b0e4de94af0d237870c8f6cdddcf7d500b550de9c912fb0679294239ddb",
  "mrsigner": "ead6b106311614ab8cf26606e2583b61be82a43109e14d4fc91609286a58ab10",
  "isvprodid": 10001,
  "isvsvn": 13003
}
```

### b. Using bash commands

1. mrenclave - 32 bytes at offset 960

```bash
# dd if=~/sigstruct.bin of=~/mrenclave.bin bs=1 skip=960 count=32
# xxd -p ~/mrenclave.bin | tr -d '\n'
53cc2b0e4de94af0d237870c8f6cdddcf7d500b550de9c912fb0679294239ddb
```
2. mrsigner - sha256 over 384 bytes at offset 128

```bash
# dd if=~/sigstruct.bin of=~/mrsigner.bin bs=1 skip=128 count=384
# sha256sum ~/mrsigner.bin 
ead6b106311614ab8cf26606e2583b61be82a43109e14d4fc91609286a58ab10
```
3. RUN 3. isvprodid - 2 bytes - little endian at position 1024

```bash
# od --endian=little --read-bytes=2 -j 1024 -s ~/sigstruct.bin | awk '{print $2}'
10001
```
4. isvsvn - 2 bytes - little endian at position 1026

```bash
# od --endian=little --read-bytes=2 -j 1026 -s ~/sigstruct.bin | awk '{print $2}'
13003
```

### c. Using Javascript

Quick javascript sample code that outputs values to console

```bash
<input type="file" />
<div id="result"></div>

<script>
  function toHexString(byteArray) {
      return Array.from(byteArray, function(byte) {
          return ('0' + (byte & 0xFF).toString(16)).slice(-2);
      }).join('')
  }
  document.querySelector('input').addEventListener('change', function() {
      var reader = new FileReader();
      reader.onload = function() {
          var arrayBuffer = this.result;
          var array = new Uint8Array(arrayBuffer);

          const mrenclave = toHexString(array.slice(960,960+32));
          console.log("mrenclave=" + mrenclave);

          const mrsignerbytes = array.slice(128,128+384);
          crypto.subtle.digest('SHA-256', mrsignerbytes).then(hash => {
              const mrsigner = toHexString(new Uint8Array(hash));
              console.log("mrsigner=" + mrsigner);
          });

          const isvsvn = array[1024] + array[1025] * 256;
          console.log("isvsvn=" + isvsvn);
          const isvprodid = array[1026] + array[1027] * 256;
          console.log("isvprodid=" + isvprodid);
      }
      reader.readAsArrayBuffer(this.files[0]);

  }, false);

</script>
```

Example output:

```bash
1.html:17 mrenclave=53cc2b0e4de94af0d237870c8f6cdddcf7d500b550de9c912fb0679294239ddb
1.html:26 isvsvn=10001
1.html:28 isvprodid=13003
1.html:22 mrsigner=ead6b106311614ab8cf26606e2583b61be82a43109e14d4fc91609286a58ab10
```

## 2. Installing rust quickly

```bash
# apt-get update && apt-get install -y wget curl build-essential g++ clang pkg-config libssl-dev protobuf-compiler libclang-dev cmake
# wget https://sh.rustup.rs -O ./rust.sh && chmod u+x ./rust.sh && ./rust.sh -y && echo "source ~/.cargo/env" >> ~/.bashrc
# source ~/.cargo/env && rustup toolchain add nightly && rustup default nightly && rustup target add x86_64-fortanix-unknown-sgx --toolchain nightly && cargo install fortanix-sgx-tools sgxs-tools
# echo -e "[target.x86_64-fortanix-unknown-sgx]\nrunner = \"ftxsgx-runner-cargo\"" > ~/.cargo/config
```

## Related

- [Encryption](/encryption.md)
- [Sequoia-PGP](/clients-sequoia-pgp.md)
- [Add Quorum Approval Policy](/add-quorum-approval-policy.md)
- [FAQs - Fortanix Data Security Manager UI](/faqs-fortanix-data-security-manager-ui.md)
- [Decryption](/decryption.md)
