src/main/java/app/coronawarn/verification/service/AppSessionService.java
/**
   * This method generates a registration Token by a TeleTAN.
   *
   * @param teleTan the TeleTan
   * @return an {@link ResponseEntity}
   */
This method generates a registration Token by a TeleTAN.
@param teleTan the TeleTan
@return an  ResponseEntity
This method generates a registration Token by a TeleTAN . @param teleTan the TeleTan @return an ResponseEntity
public ResponseEntity<RegistrationToken> generateRegistrationTokenByTeleTan(
    String teleTan, String fake, TeleTanType teleTanType) {
    if (checkRegistrationTokenAlreadyExistForTeleTan(teleTan)) {
      log.warn("The registration token already exists for this TeleTAN.");
      return ResponseEntity.badRequest().build();
    } else {
      log.info("Start generating a new registration token for the given TeleTAN.");
      String registrationToken = generateRegistrationToken();
      VerificationAppSession appSession = generateAppSession(registrationToken);
      appSession.setTeleTanHash(hashingService.hash(teleTan));
      appSession.setSourceOfTrust(AppSessionSourceOfTrust.TELETAN);
      appSession.setTeleTanType(teleTanType);
      saveAppSession(appSession);
      log.info("Returning the successfully created registration token.");
      return ResponseEntity.status(HttpStatus.CREATED).body(
        getBackwardCompatibleRegistrationToken(registrationToken, fake));
    }
  }
public ResponseEntity < RegistrationToken > generateRegistrationTokenByTeleTan ( String teleTan , String fake , TeleTanType teleTanType ) { if ( checkRegistrationTokenAlreadyExistForTeleTan ( teleTan ) ) { log . warn ( "The registration token already exists for this TeleTAN." ) ; return ResponseEntity . badRequest ( ) . build ( ) ; } else { log . info ( "Start generating a new registration token for the given TeleTAN." ) ; String registrationToken = generateRegistrationToken ( ) ; VerificationAppSession appSession = generateAppSession ( registrationToken ) ; appSession . setTeleTanHash ( hashingService . hash ( teleTan ) ) ; appSession . setSourceOfTrust ( AppSessionSourceOfTrust . TELETAN ) ; appSession . setTeleTanType ( teleTanType ) ; saveAppSession ( appSession ) ; log . info ( "Returning the successfully created registration token." ) ; return ResponseEntity . status ( HttpStatus . CREATED ) . body ( getBackwardCompatibleRegistrationToken ( registrationToken , fake ) ) ; } }
This method generates a registration Token by a TeleTAN.
This method generates a registration Token by a TeleTAN .