public byte[] UntrustedHashSign(KeyPath keyPath, UserPin pin, LockTime lockTime, SigHash sigHashType)
{
MemoryStream data = new MemoryStream();
byte[] path = Serializer.Serialize(keyPath);
BufferUtils.WriteBuffer(data, path);
var pinBytes = pin == null ? new byte[0] : pin.ToBytes();
data.WriteByte((byte)pinBytes.Length);
BufferUtils.WriteBuffer(data, pinBytes);
BufferUtils.WriteUint32BE(data, (uint)lockTime);
data.WriteByte((byte)sigHashType);
return(CreateAPDU(LedgerWalletConstants.LedgerWallet_CLA, LedgerWalletConstants.LedgerWallet_INS_HASH_SIGN, (byte)0x00, (byte)0x00, data.ToArray()));
}