
At AegisCloud, certificate identifiers must follow a strict string format before they can be processed. Implement a function that returns True if a certificate string is valid and False otherwise.
A certificate string is valid if all of the following are true:
header:payload:signature.A-Z), digits (0-9), and the delimiter characters (, ), [, ], {, }.cert, a stringbool — whether the certificate format is validExample 1
cert = "AB[12]:C{D}3:XYZ9"TrueExample 2
cert = "AB[12:C{D}3:XYZ9"False[ delimiter is never closed.1 <= len(cert) <= 10^5cert = "AB[12]:C{D}3:XYZ9"OutputTrueWhyThe string has exactly three non-empty segments, uses only allowed characters, and all delimiters are balanced.cert = "AB[12:C{D}3:XYZ9"OutputFalseWhyThe opening `[` is never closed, so the delimiter structure is invalid.cert = "AB::XYZ"OutputFalseWhyThere is an empty middle segment because of consecutive colons.1 <= len(cert) <= 10^5The input string contains ASCII charactersA valid certificate must contain exactly two colonsEach of the three segments must be non-emptydef validate_certificate(cert):