It looks like you want to sign the Invoice using your own code.
yes, to get the Signed PropertiesHash you can use the tag as in the guide. make sure we have 36 spaces before the <xades:SignedSignatureProperties>
tag and for other tags must be formatted with 4 spaces.
internal static string GetSignedPropertiesHash(string signingTime, string digestValue, string x509IssuerName, string x509SerialNumber)
{
string xmlString = $@"<xades:SignedProperties xmlns:xades=""http://uri.etsi.org/01903/v1.3.2#"" Id=""xadesSignedProperties"">
<xades:SignedSignatureProperties>
<xades:SigningTime>{signingTime}</xades:SigningTime>
<xades:SigningCertificate>
<xades:Cert>
<xades:CertDigest>
<ds:DigestMethod xmlns:ds=""http://www.w3.org/2000/09/xmldsig#"" Algorithm=""http://www.w3.org/2001/04/xmlenc#sha256""/>
<ds:DigestValue xmlns:ds=""http://www.w3.org/2000/09/xmldsig#"">{digestValue}</ds:DigestValue>
</xades:CertDigest>
<xades:IssuerSerial>
<ds:X509IssuerName xmlns:ds=""http://www.w3.org/2000/09/xmldsig#"">{x509IssuerName}</ds:X509IssuerName>
<ds:X509SerialNumber xmlns:ds=""http://www.w3.org/2000/09/xmldsig#"">{x509SerialNumber}</ds:X509SerialNumber>
</xades:IssuerSerial>
</xades:Cert>
</xades:SigningCertificate>
</xades:SignedSignatureProperties>
</xades:SignedProperties>".Replace("\r\n", "\n"); // Normalize line endings to LF only
byte[] hashBytes = SHA256.HashData(Encoding.UTF8.GetBytes(xmlString.Trim()));
string hashHex = BitConverter.ToString(hashBytes).Replace("-", "").ToLower();
return Convert.ToBase64String(Encoding.UTF8.GetBytes(hashHex));
}
For complete code you can see my Zatca.eInvoice library in my Github Repository.
hope this help…