public static synchronized TokenInfo createToken(TokenType tokenType){
  Token token=new Token(tokenType.getModuleType(),tokenType.getId());
  token.setModuleId(tokenType.getModuleType());
  token.setReadOnly(tokenType.isReadOnly());
  token.setSerialNumber(tokenType.getSerialNumber());
  token.setLabel(tokenType.getLabel());
  token.setSlotIndex(tokenType.getSlotIndex());
  token.setFriendlyName(getDefaultFriendlyName(tokenType));
  token.setBatchSigningEnabled(tokenType.isBatchSigningEnabled());
  token.setAvailable(true);
  currentTokens.add(token);
  return token.toDTO();
}

public static synchronized TokenInfo createToken ( TokenType tokenType ) { Token token = new Token ( tokenType . getModuleType ( ) , tokenType . getId ( ) ) ; token . setModuleId ( tokenType . getModuleType ( ) ) ; token . setReadOnly ( tokenType . isReadOnly ( ) ) ; token . setSerialNumber ( tokenType . getSerialNumber ( ) ) ; token . setLabel ( tokenType . getLabel ( ) ) ; token . setSlotIndex ( tokenType . getSlotIndex ( ) ) ; token . setFriendlyName ( getDefaultFriendlyName ( tokenType ) ) ; token . setBatchSigningEnabled ( tokenType . isBatchSigningEnabled ( ) ) ; token . setAvailable ( true ) ; currentTokens . add ( token ) ; return token . toDTO ( ) ; }
creates a new token with specified type .
