Remove unused methods
Methods were unused and relied on hardcoded issuer names (ouch!).
@@ -17,20 +17,8 @@ import static com.yahoo.security.SubjectAlternativeName.Type.RFC822_NAME;
*/
public class AthenzX509CertificateUtils {
- private static final String COMMON_NAME_ROLE_DELIMITER = ":role.";
-
private AthenzX509CertificateUtils() {}
- public static boolean isAthenzRoleCertificate(X509Certificate certificate) {
- return isAthenzIssuedCertificate(certificate) &&
- com.yahoo.security.X509CertificateUtils.getSubjectCommonNames(certificate).get(0).contains(COMMON_NAME_ROLE_DELIMITER);
- }
-
- public static boolean isAthenzIssuedCertificate(X509Certificate certificate) {
- return com.yahoo.security.X509CertificateUtils.getIssuerCommonNames(certificate).stream()
- .anyMatch(cn -> cn.equalsIgnoreCase("Yahoo Athenz CA") || cn.equalsIgnoreCase("Athenz AWS CA"));
- }
-
public static AthenzIdentity getIdentityFromRoleCertificate(X509Certificate certificate) {
List<com.yahoo.security.SubjectAlternativeName> sans = com.yahoo.security.X509CertificateUtils.getSubjectAlternativeNames(certificate);
return sans.stream()
