Sort certificates by AKI/SKI to form a valid chain.
Starting from a leaf certificate, builds the chain by matching
each certificate's AKI with the next certificate's SKI.
Parameters
leaf: Certificate
The leaf certificate (starting point of the chain)
others: Certificate[]
Array of intermediate and root certificates (in any order)
Sort certificates by AKI/SKI to form a valid chain. Starting from a leaf certificate, builds the chain by matching each certificate's AKI with the next certificate's SKI.