@@ -44,6 +44,14 @@ public class CertificateDataPopulator {
4444 private static final String [] EMAIL_DOMAINS = {
4545 "gmail.com" , "mail.kz" , "yandex.kz" , "outlook.com"
4646 };
47+ private static final String [] KAZAKH_CA_NAMES = {
48+ "НЕГІЗГІ КУӘЛАНДЫРУШЫ ОРТАЛЫҚ (RSA) TEST 2025" ,
49+ "НЕГІЗГІ КУӘЛАНДЫРУШЫ ОРТАЛЫҚ (RSA) TEST 2026" ,
50+ "НЕГІЗГІ КУӘЛАНДЫРУШЫ ОРТАЛЫҚ (RSA) TEST 2027" ,
51+ "ҚАЗАҚСТАН РЕСПУБЛИКАСЫНЫҢ КУӘЛАНДЫРУШЫ ОРТАЛЫҒЫ TEST 2028" ,
52+ "ҰЛТТЫҚ КУӘЛАНДЫРУШЫ ОРТАЛЫҚ (RSA) TEST 2029" ,
53+ "БІРІККЕН КУӘЛАНДЫРУШЫ ОРТАЛЫҚ ҚАЗАҚСТАН TEST 2030"
54+ };
4755
4856 /**
4957 * Generate a random 12-digit IIN (Individual Identification Number).
@@ -68,7 +76,7 @@ public static String populateBIN() {
6876 * Generate a random Kazakh company name.
6977 */
7078 public static String populateCompany () {
71- return KAZAKH_COMPANIES [random .nextInt (KAZAKH_COMPANIES .length )];
79+ return KAZAKH_COMPANIES [random .nextInt (KAZAKH_COMPANIES .length )] + " (TEST)" ;
7280 }
7381
7482 /**
@@ -92,6 +100,14 @@ public static String populateEmail() {
92100 return "%s@%s" .formatted (local , domain );
93101 }
94102
103+ /**
104+ * Generate subject DN for a CA certificate with random selection from available names.
105+ */
106+ public static String populateCASubjectDN () {
107+ String caName = KAZAKH_CA_NAMES [random .nextInt (KAZAKH_CA_NAMES .length )];
108+ return "C=KZ, CN=%s, L=KNCA-SIGNER" .formatted (caName );
109+ }
110+
95111 /**
96112 * Generate subject DN for an individual certificate.
97113 */
@@ -102,7 +118,7 @@ public static String populateIndividualSubjectDN() {
102118 String fullName = givenName + " " + surname ;
103119 String iin = populateIIN ();
104120 String email = populateEmail ();
105- return "CN=%s, SURNAME=%s, SN=IIN%s, C=KZ, G=%s, emailAddress=%s" .formatted (fullName , surname , iin , patronymic , email );
121+ return "CN=%s, SURNAME=%s, SN=IIN%s, C=KZ, L=KNCA-SIGNER, G=%s, emailAddress=%s" .formatted (fullName , surname , iin , patronymic , email );
106122 }
107123
108124 /**
@@ -113,13 +129,13 @@ public static String populateLegalEntitySubjectDN() {
113129 String givenName = KAZAKH_GIVEN_NAMES [random .nextInt (KAZAKH_GIVEN_NAMES .length )];
114130 String patronymic = KAZAKH_PATRONYMICS [random .nextInt (KAZAKH_PATRONYMICS .length )];
115131 String fullName = givenName + " " + surname ;
116- String company = KAZAKH_COMPANIES [random .nextInt (KAZAKH_COMPANIES .length )];
132+ String company = KAZAKH_COMPANIES [random .nextInt (KAZAKH_COMPANIES .length )] + " (TEST)" ;
117133 String bin = populateBIN ();
118134 String iin = populateIIN ();
119135 String email = populateEmail ();
120136 String businessCategory = BUSINESS_CATEGORY [random .nextInt (BUSINESS_CATEGORY .length )];
121137 String dc = COMPANY_ROLES [random .nextInt (COMPANY_ROLES .length )];
122- return "CN=%s, SURNAME=%s, SN=IIN%s, C=KZ, O=%s, OU=BIN%s, BusinessCategory=%s, G=%s, DC=%s, emailAddress=%s" .formatted (
138+ return "CN=%s, SURNAME=%s, SN=IIN%s, C=KZ, O=%s, L=KNCA-SIGNER, OU=BIN%s, BusinessCategory=%s, G=%s, DC=%s, emailAddress=%s" .formatted (
123139 fullName , surname , iin , company , bin , businessCategory , patronymic , dc , email );
124140 }
125141
@@ -161,7 +177,7 @@ public static String populateLegalEntitySubjectDN(String company, String bin) {
161177 String email = populateEmail ();
162178 String businessCategory = BUSINESS_CATEGORY [random .nextInt (BUSINESS_CATEGORY .length )];
163179 String dc = COMPANY_ROLES [random .nextInt (COMPANY_ROLES .length )];
164- return "CN=%s, SURNAME=%s, SN=IIN%s, C=KZ, O=%s, OU=BIN%s, BusinessCategory=%s, G=%s, DC=%s, emailAddress=%s" .formatted (
180+ return "CN=%s, SURNAME=%s, SN=IIN%s, C=KZ, O=%s, L=KNCA-SIGNER, OU=BIN%s, BusinessCategory=%s, G=%s, DC=%s, emailAddress=%s" .formatted (
165181 fullName , surname , iin , company , bin , businessCategory , patronymic , dc , email );
166182 }
167183
0 commit comments