Extract a partial certificate chain from a certificate chain so that the
total size of the chain does not exceed maxSize.
If maxSize is not provided, the full certificate chain is returned.
If the first certificate in the chain already exceeds maxSize, an error is thrown.
Parameters
OptionalcertificateChain: DER|DER[]|null
full certificate chain (single DER buffer or array)
OptionalmaxSize: number
optional byte budget
Returns DER[]
the truncated chain as an array of individual certificates
Extract a partial certificate chain from a certificate chain so that the total size of the chain does not exceed maxSize. If maxSize is not provided, the full certificate chain is returned. If the first certificate in the chain already exceeds maxSize, an error is thrown.