tvaultapi/src/main/java/com/tmobile/cso/vault/api/service/SSLCertificateService.java
private String updatedRequestWithCN(String jsonString, SSLCertificateRequest sslCertificateRequest) {
        JsonParser jsonParser = new JsonParser();
        JsonObject jsonObject = (JsonObject) jsonParser.parse(jsonString);
        JsonObject jsonObject1 = jsonObject.getAsJsonObject(SSLCertificateConstants.SUBJECT);
        JsonArray jsonArray = jsonObject1.getAsJsonArray(SSLCertificateConstants.ITEMS);
        JsonObject jsonObject2 = null;
        for (int i = 0; i < jsonArray.size(); i++) {
            JsonElement jsonElement = jsonArray.get(i);
            jsonObject2 = jsonElement.getAsJsonObject();
            if (jsonObject2.get(SSLCertificateConstants.TYPENAME).getAsString().equals(SSLCertificateConstants.CN)) {
                JsonArray jsonArray2 = jsonElement.getAsJsonObject().getAsJsonArray(SSLCertificateConstants.VALUE);
				for (int j = 0; j < jsonArray2.size(); j++) {
					JsonElement jsonElement1 = jsonArray2.get(j);
					jsonObject2 = jsonElement1.getAsJsonObject();
					jsonObject2.addProperty(SSLCertificateConstants.VALUE, sslCertificateRequest.getCertificateName());
					if (j == 1) {
						break;
					}
				}
            }
			if (i == 1) {
				break;
			}
        }
        return jsonObject.toString();
    }
/**
     * This method will be responsible for updating request with certificate name
     * @param jsonString
     * @param sslCertificateRequest
     * @return
     */
This method will be responsible for updating request with certificate name
@param jsonString
@param sslCertificateRequest
@return
This method will be responsible for updating request with certificate name @param jsonString @param sslCertificateRequest @return
private String updatedRequestWithCN(String jsonString, SSLCertificateRequest sslCertificateRequest) {
        JsonParser jsonParser = new JsonParser();
        JsonObject jsonObject = (JsonObject) jsonParser.parse(jsonString);
        JsonObject jsonObject1 = jsonObject.getAsJsonObject(SSLCertificateConstants.SUBJECT);
        JsonArray jsonArray = jsonObject1.getAsJsonArray(SSLCertificateConstants.ITEMS);
        JsonObject jsonObject2 = null;
        for (int i = 0; i < jsonArray.size(); i++) {
            JsonElement jsonElement = jsonArray.get(i);
            jsonObject2 = jsonElement.getAsJsonObject();
            if (jsonObject2.get(SSLCertificateConstants.TYPENAME).getAsString().equals(SSLCertificateConstants.CN)) {
                JsonArray jsonArray2 = jsonElement.getAsJsonObject().getAsJsonArray(SSLCertificateConstants.VALUE);
				for (int j = 0; j < jsonArray2.size(); j++) {
					JsonElement jsonElement1 = jsonArray2.get(j);
					jsonObject2 = jsonElement1.getAsJsonObject();
					jsonObject2.addProperty(SSLCertificateConstants.VALUE, sslCertificateRequest.getCertificateName());
					if (j == 1) {
						break;
					}
				}
            }
			if (i == 1) {
				break;
			}
        }
        return jsonObject.toString();
    }
private String updatedRequestWithCN ( String jsonString , SSLCertificateRequest sslCertificateRequest ) { JsonParser jsonParser = new JsonParser ( ) ; JsonObject jsonObject = ( JsonObject ) jsonParser . parse ( jsonString ) ; JsonObject jsonObject1 = jsonObject . getAsJsonObject ( SSLCertificateConstants . SUBJECT ) ; JsonArray jsonArray = jsonObject1 . getAsJsonArray ( SSLCertificateConstants . ITEMS ) ; JsonObject jsonObject2 = null ; for ( int i = 0 ; i < jsonArray . size ( ) ; i ++ ) { JsonElement jsonElement = jsonArray . get ( i ) ; jsonObject2 = jsonElement . getAsJsonObject ( ) ; if ( jsonObject2 . get ( SSLCertificateConstants . TYPENAME ) . getAsString ( ) . equals ( SSLCertificateConstants . CN ) ) { JsonArray jsonArray2 = jsonElement . getAsJsonObject ( ) . getAsJsonArray ( SSLCertificateConstants . VALUE ) ; for ( int j = 0 ; j < jsonArray2 . size ( ) ; j ++ ) { JsonElement jsonElement1 = jsonArray2 . get ( j ) ; jsonObject2 = jsonElement1 . getAsJsonObject ( ) ; jsonObject2 . addProperty ( SSLCertificateConstants . VALUE , sslCertificateRequest . getCertificateName ( ) ) ; if ( j == 1 ) { break ; } } } if ( i == 1 ) { break ; } } return jsonObject . toString ( ) ; }
This method will be responsible for updating request with certificate name
 @param jsonString
 @param sslCertificateRequest
 @return
This method will be responsible for updating request with certificate name @param jsonString @param sslCertificateRequest @return