private JsonObject toJsonObject ( ) { JsonObjectBuilder factory = Json . createObjectBuilder ( ) ; if ( enrollmentID != null ) { // revoke all enrollments of this user, serial and aki are ignored in this case factory . add ( "id" , enrollmentID ) ; } else { // revoke one particular enrollment factory . add ( "serial" , serial ) ; factory . add ( "aki" , aki ) ; } if ( null != reason ) { factory . add ( "reason" , reason ) ; } if ( caName != null ) { factory . add ( HFCAClient . FABRIC_CA_REQPROP , caName ) ; } if ( genCRL != null ) { factory . add ( "gencrl" , genCRL ) ; } return factory . build ( ) ; }
Convert the revocation request to a JSON object