I need Java Regex which can match the argument used to set ciphers for SSL/TLS
valid ciphers : (For testing multiple pattern at a go, added them to string with comma separated, later iterating each for pattern match)
"ALL:!kRSA:!CBC,ALL:-aRSA:-CBC:SHA256,ALL:!kRSA,ALL:!aRSA,ALL:!RSA,ALL:!EDH-RSA-DES-CBC-SHA,ALL:!DES-CBC,ALL:!DES,ALL:-RSA+AES-128-CBC+SHA256";
Can be matched with regex = "^((?:ALL)|(?:ALL)(:([!-]?(a|k)?[A-Z0-9]+([+-]?(a|k)?[A-Z0-9]+)?)*)*)$";
But when I try invalid ciphers: (basically it should fail to match)
invalidciphers = "ALL:+DES,+DES,-DES,DEFAULT:-aRSA,akRSA,kDHE-aRSA,!ECDHE";
unable to create one.
Can any one help me out?