Against you, you only, have I sinned
and done what is evil in your sight,
so that you may be justified in your words
and blameless in your judgment.
David repented of much sin in Psalm 51. These words came flowing from him after at least a year of committing and covering the really big sins of adultery, murder, and conspiracy. And when Nathan the prophet is sent by God to confront David, once David is caught in conviction, he released his repentance with tears and contrition.
Even though David's sin had a wide human impact affecting the entire nation, and even though David's actions according to the Law demanded his death, he repented exclusively to God in this Psalm. And in that acknowledgement of the guilt of his sin against God, he knew God's words that confronted sin were justified and the resultant actions of God that judged David's sins were blameless.
This is no small assent on the part of David. The judgment on this sin brought the death of an infant son and eventually over painful family crisis the death of another adult son. It cost David in intense family strife and national civil war. But those judgmental consequences decreed by a holy God are accepted as blameless by David. That is the manliest part of David's repentance as I see it in this psalm.