How remove Public Key to sign just with Secret Key TElX509Certificate

Hello
I am trying to remove only the public key part of a certificate stored in a SBX509.TElX509Certificate object.
I need to sign a document using only the secret key part, but with all the other properties.
But when I used KeyMaterial.ClearPublic, PrivateKeyExists propertie change to False also.
My Code:

MyJustPrivateCert:= TElX509Certificate.Create(nil);

OriginalFullCert.Clone(MyJustPrivateCert:, true); //clone the original full private and public key certificate to new one with all properties
//here MyJustPrivateCert.PrivateKeyExists is True

MyJustPrivateCert.KeyMaterial.ClearPublic; // I guess removes only the public key
//after that MyJustPrivateCert.PrivateKeyExists is False

I need to remove only the public key part of the TElX509Certificate object, leaving the SecretKey part and all other properties.
Thanks for the help.

Im trying to sign an Electronic Invoice for the Costa Rican Govermment.
The standard defined for that is, to separate the original certificate in 2 parts, the public and the private, and use ONLY the private part to sign.

Im loading the full certificate in the SBX509.TElX509Certificate object, and try to remove the public part to leave only the private part to sign. I already know that only the private part is used to sign for the component, but if I use the whole cerificate, the validation for the standard fails.

Needs to separate both parts and leave a SBX509.TElX509Certificate with only the private key to sign with that.

Other developers use tools as OpenSSL to split the certificate, but I need to do it with the SBX509.TElX509Certificate object.

"I need to sign" is not enough to understand what algorithm should be used for signing. In most standard algorithms the requirement to use only the private part is non-sense. So we need to understand how they want you to sign the data.

They meants, that the original certificate must be splitted in private and public key parts (as OpenSSL do it). After that must use only the private key part resulting, to sign the document using PKCS#7.